Fix memory leak when GUI window is closed#198
Fix memory leak when GUI window is closed#198micahrj merged 5 commits intoRustAudio:masterfrom dathinaios:master
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):
|
|
Just to enquire. Was there a reason that this has not been merged? Have been using the change since this PR without issues. |
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?