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 leaks #193
Fix memory leaks #193
Conversation
Leaks were observed in isenkramd on Debian Diagnosis and confirmation of the fix via valgrind
|
There are still a couple much lower-rate leaks shown in valgrind, but I don't have the energy to wrap them up tonight. I can deal with them tomorrow: ==26466== 67,550 (16,160 direct, 51,390 indirect) bytes in 404 blocks are definitely lost in loss record 5,530 of 5,538 |
|
The added third commit addresses the leak in as_utils_find_files_matching. I don't have enough knowledge of the code to immediately see where the last leak loses its reference to the affected object, so someone else will have to address that. I've opened bug #194 for this. |
|
Thank you for your patch! I will review & merge it later today. |
|
Ah, I didn't know those facilities were available. Now that it's got your
attention, could I let you fix it the preferred way?
On Jun 14, 2018 9:13 AM, "Matthias Klumpp" <notifications@github.com> wrote:
Thank you for your patch! I will review & merge it later today.
One thing that is notable is that the patch can be simplified by using the
g_auto macro to automatically finalize a GVariantDict when going out of the
current scope. That prevents the issue from happening again and simplifies
the code.
The same can likely be done for the GVariant (via g_autoptr) related issue
and for the path string in find_files_matching using g_autofree there.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#193 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAHuAL_iqNlsxoLdEhAKQSHSYihpANuwks5t8m99gaJpZM4UnWZx>
.
|
Yes, sorry for taking so long to merge this (I wanted to make sure that when I merge the changes I can also adjust them to use g_auto* immediately). Thank you for your contribution! |
Together, these were leaking megabytes at a time in the downstream program isenkramd every time I plugged in my mouse.