nashaofu / xcap

XCap is a cross-platform screen capture library written in Rust. It supports Linux (X11, Wayland), MacOS, and Windows. XCap supports screenshot and video recording (to be implemented).
https://docs.rs/xcap
Apache License 2.0
459 stars 55 forks source link

memory leak in `Windows:all()` on macos #148

Closed louis030195 closed 3 weeks ago

louis030195 commented 3 weeks ago
Screenshot 2024-08-24 at 17 21 33

https://github.com/nashaofu/xcap/blob/daff24c6a50bf1fc38f6f9974ced71d8d48004c5/src/macos/impl_window.rs#L177

https://github.com/servo/core-foundation-rs/blob/b2fdaf4132a8fff7aadd6885ec7c570296a664ea/core-graphics/src/window.rs#L145 any idea how to fix?

i tried to release the object manually but got seg faults then

louis030195 commented 3 weeks ago

https://github.com/louis030195/xcap/blob/75a7152b1990a182b16af67ae3db9d8916e0a734/src/macos/impl_window.rs#L262 added a test

nashaofu commented 3 weeks ago

fixed #149