-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix memory leak when GUI window is closed #198
base: master
Are you sure you want to change the base?
Conversation
Good work on diagnosing this and coming up with a working fix! Unfortunately I don't think this is really the correct fix. First, it shouldn't be necessary to remove subviews when closing the window, as subviews don't keep their superview alive, so this change should have the same effect without the calls to It looks like the only place where we call Line 96 in cd4df61
Right above that line is a call to Line 94 in cd4df61
I think the true fix for this leak is to just remove that line. |
Thank you for the detailed review. I tested the requested changes and they seem to work great 👍 |
The windows portion of the change isn't correct either; the purpose of the Lines 453 to 456 in cd4df61
The rationale for doing that is to defer the actual |
Yes, I see. I have commented out the |
I would rather merge this PR with just the macOS fix and then implement a proper fix for Windows in a separate PR. The problem with the |
After doing some local testing on Windows, I observe the same memory leak in the |
I was able to find the root cause of the memory leak on Windows (#199), so the Windows changes in this PR can be removed. |
Ok, tested with the Gain Vizia example multiple times (Parallels Win 11 on an Apple Silicon Mac):
|
As per #197
The changes made here appear to fix the issue for Mac and Windows but I am not sure this is the correct way to solve it. I haven't tested on Linux, could someone check if the issue also happens there?