GNOME Bugzilla – Bug 735547
Plug the memory leaks
Last modified: 2016-09-20 09:46:07 UTC
After simply running five-or-more, opening preferences, closing preferences, and closing the main window, here's what I got from valgrind: ('valgrind --tool=memcheck five-or-more') ==3812== LEAK SUMMARY: ==3812== definitely lost: 3,856 bytes in 7 blocks ==3812== indirectly lost: 21,717 bytes in 928 blocks ==3812== possibly lost: 57,136 bytes in 851 blocks ==3812== still reachable: 5,029,611 bytes in 80,121 blocks ==3812== suppressed: 0 bytes in 0 blocks
Created attachment 284636 [details] [review] Unref the UI builders
Review of attachment 284636 [details] [review]: Thanks!
Are there more leaks, or did you forget to close the bug?
Yes, I have found some more, but no patches yet, will check out those and will close the bug when I'm happy with the valgrind results :)
Created attachment 293558 [details] [review] No new game confirmation before first move (bgo #736989)
Comment on attachment 293558 [details] [review] No new game confirmation before first move (bgo #736989) Whoops, attached to the wrong bug.
Created attachment 294169 [details] [review] Do not get pixbuf formats to free it
Review of attachment 294169 [details] [review]: Please commit this to gnome-robots as well.
Review of attachment 294169 [details] [review]: Committed to both gnome-robots and five-or-more.
Created attachment 294183 [details] [review] Fixed various possible memory leaks. * Made some global variables local-only * Free objects as soon as possible * Make sure cleanup is called both on quit and close
Review of attachment 294183 [details] [review]: ::: src/five-or-more.c @@ +1462,3 @@ + int i = 0; + + for (i = 0; i < G_N_ELEMENTS(preview_images); i++) missing space @@ +1469,3 @@ + g_object_unref (ball_preimage); + ball_preimage = NULL; + } This entire conditional: if (ball_preimage) { g_object_unref (ball_preimage); ball_preimage = NULL; } Is equivalent to: g_clear_object (&ball_preimage);
Review of attachment 294183 [details] [review]: Committed with the suggested changes.
As the memory leaks found so far have been fixed, I am marking this as fixed, other memory leaks found should be handled in separate bug reports.
This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.