Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when closing window #197

Open
dathinaios opened this issue Nov 16, 2024 · 0 comments
Open

Memory leak when closing window #197

dathinaios opened this issue Nov 16, 2024 · 0 comments

Comments

@dathinaios
Copy link
Contributor

As reported at robbert-vdh/nih-plug#173. I can reproduce on a Mac on Bitwig and Reaper on a nih_plug plugin (parented window).

The following addition on WindowInner's close function for Mac resolves the issue for me on Mac:

// Ensure all subviews are detached and released
let subviews: id = msg_send![self.ns_view, subviews];
let count: usize = msg_send![subviews, count];
for i in 0..count {
    let subview: id = msg_send![subviews, objectAtIndex: i];
    subview.removeFromSuperview();
    let () = msg_send![subview, release];
}

A similar change need to happen on Windows and Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant