-
Notifications
You must be signed in to change notification settings - Fork 10
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 corruption after calling methods that return SList with transfer-ownership="none" #183
Comments
Thanks for the bug report. These issues a really annoying to debug. This helps a lot. |
Jemalloc is really nice for finding memory leaks, but finding when and what has been preemptively been free'd is tough. This is related, so I'm not sure if this needs to be a separate report, but there are other issues also involving returns with transfer-ownership="none". |
Similarly, |
Ah. Thanks for explaining that. I'm still seeing some other memory issues, at least a failure to free |
Awesome! May I ask what you are developing? |
Do not free unowned GList/GSlist (fixes #183)
I've been trying to figure out what's causing memory corruption when I'm rendering text, and I think I've found it.
The finalizer registered to the
Cleaner
in theSList
constructor universally callsSListNode.free(new SListNode(address));
even when java-gi doesn't own the memory and shouldn't be freeing it. Examples includeLayout.getLinesReadonly()
inPango
.Retaining a reference to the
SList
to prevent the finalizer from running does prevent the memory corruption.The text was updated successfully, but these errors were encountered: