Brooooooklyn / canvas

High performance skia binding to Node.js. Zero system dependencies and pure npm packages without any postinstall scripts nor node-gyp.
https://vercel.skia.rs
MIT License
1.78k stars 76 forks source link

fix: memory leak in Image #934

Closed Brooooooklyn closed 2 weeks ago

Brooooooklyn commented 2 weeks ago

There 2 leak points in the Image class.

  1. The Env::create_reference was wrong in NAPI-RS, related pr: https://github.com/napi-rs/napi-rs/pull/2347, change to the Ref::new can resolve it.
  2. The PromiseRaw::catch callback was leaked, it cause the whole Image objects not be GCed, it was fixed in https://github.com/napi-rs/napi-rs/pull/2348
Brooooooklyn commented 2 weeks ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Brooooooklyn and the rest of your teammates on Graphite Graphite

Brooooooklyn commented 2 weeks ago

Merge activity

fengmk2 commented 2 weeks ago

感谢修复,公司内部通过压测验证修复有效!☆( ̄▽ ̄)/$:*