GNOME Bugzilla – Bug 729732
Various memory leak fixes
Last modified: 2014-05-07 17:05:43 UTC
Found running the default plugin under valgrind. Some are real fixes (particularly the stack stuff), some are bugs but not big ones (the dbus stuff becomes big only if one keeps changing VT), some are just there to please valgrind (like the wayland table)
Created attachment 276085 [details] [review] MetaIdleMonitorDBus: unref the objects after exporting them The object manager already has a reference.
Created attachment 276086 [details] [review] MetaDisplay: free the wayland windows table at close Like we do for the XID table.
Created attachment 276087 [details] [review] default: free the option context after parsing We don't need it, we should free it.
Created attachment 276088 [details] [review] MetaStackTracker: make sure all stack ops are freed eventually If we apply a prediction immediately instead of queueing, we should also free the operation immediately. If we discard the prediction queue because we resync fully, we need to free each operation too.
Created attachment 276089 [details] [review] xprops: free the text list content too A text list is an array of pointers into a buffer. Freeing the array is not enough, we need to free the buffer too.
Review of attachment 276089 [details] [review]: ::: src/x11/xprops.c @@ +758,3 @@ + + this is unfortunately an implementation detail of libX11, + and there is no public function to free the list I assume you missed XFreeStringList?
Review of attachment 276088 [details] [review]: OK.
Review of attachment 276087 [details] [review]: OK.
Review of attachment 276086 [details] [review]: OK. (We should be able to ditch this table eventually)
Review of attachment 276085 [details] [review]: OK.
(In reply to comment #6) > Review of attachment 276089 [details] [review]: > > ::: src/x11/xprops.c > @@ +758,3 @@ > + > + this is unfortunately an implementation detail of libX11, > + and there is no public function to free the list > > I assume you missed XFreeStringList? Oh, yeah, I only saw XwcFreeStringList. Awesome to know that.
Pushed with the suggested change, to master and, where relevant, to gnome-3-12. Attachment 276085 [details] pushed as aed6718 - MetaIdleMonitorDBus: unref the objects after exporting them Attachment 276086 [details] pushed as 1427d20 - MetaDisplay: free the wayland windows table at close Attachment 276087 [details] pushed as ab632e3 - default: free the option context after parsing Attachment 276088 [details] pushed as 098c890 - MetaStackTracker: make sure all stack ops are freed eventually Attachment 276089 [details] pushed as ea354e9 - xprops: free the text list content too