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
Widgets no longer being freed after 3.5.1 #211
Comments
Because the array was static the delegates and what there this pointer was pointing to were never freed. See Also: gtkd-developers/GtkD#211
With the static array the classes are never freed. See #211
I think that is indeed the problem. |
I see you made some commits, not sure if it's ready for testing but I gave it a shot by building tilix against GtkD master. Unfortunately, no change as I still see the same behavior from the 3.6.x series though I can see the static listener array has been removed. I'll do some more digging on my end, if you want to try tilix yourself to see the issue I can post the steps I'm using to build and reproduce it. |
Yes, could you post the steps to reproduce the issue. |
|
Did all have the listeners get re-generated properly in master after that last commit, I'm still seeing some declared as static:
|
My memory is returning, those are the hand written ones if I remember correctly. I'll comment out the places I'm using those and test again. |
Once I comment out my onDraw handlers everything works as expected so the change of listeners to static is definitely the issue. |
Because the array was static the delegates and what there this pointer was pointing to were never freed. See Also: gtkd-developers/GtkD#211
With the static array the classes are never freed. Fixes #211
I've fixed the manually added signals, and tagged version 3.6.6. |
Thanks @MikeWey, works great. |
In Tilix I've added some code ages ago to various high level widget destructors that outputs whether the destructor is called or not. I should be paying more attention to this on GtkD version updates, however I was looking into memory usage recently and noticed a change in behavior starting with 3.6.0.
In 3.5.1 if I close a tiled terminal then execute a GC collection a couple of times I can see the various destructors (VTE, Terminal) being called as expected. However starting in 3.6.0 this no longer happens and the destructors are not called until the program terminates. Now I know that in D destructors are not guarenteed to be called but I use this as a rough barometer with regards to whether I'm leaking objects.
Looking at the changes made between the two versions, there is one thing that sticks out to me. In commit 4b491f5, the event listeners array were changed from being class members to static members of the wrapper. I was wondering if this could be causing a reference to the delegate being held onto to since it never gets removed from the static unless explicitly removed.
The text was updated successfully, but these errors were encountered: