GNOME Bugzilla – Bug 769082
Fix NautilusFileUndoManager leak
Last modified: 2016-07-25 12:22:04 UTC
See patches.
Created attachment 331993 [details] [review] file-undo-manager: add file_undo_manager_destroy() NautilusFileUndoManager lacks a good cleanup mechanism, which can result in hacky code for cleaning up the singleton instance. This commit adds a function for that.
Created attachment 331994 [details] [review] application: destroy file undo manager on shutdown The NautilusFileUndoManager singleton is not being destroyed anywhere in the code, resulting in a leak. This commit adds a call to the destroy function on shutdown.
Created attachment 331996 [details] [review] file-undo-manager: add file_undo_manager_unref() NautilusFileUndoManager lacks a good cleanup mechanism, which can result in hacky code for cleaning up the singleton instance. This commit adds an unref function for that.
Created attachment 331997 [details] [review] application: unref file undo manager on shutdown The NautilusFileUndoManager singleton is not being destroyed anywhere in the code, resulting in a leak. This commit adds a call to the unref function on shutdown.
The code assumes that no one else will be refing and possibly leaking it. I changed the function from _destroy() to _unref() to indicate that this is not actually destroying it. There is probably a better way to do this.
Created attachment 332097 [details] [review] file-undo-manager: initialize singleton explicitly The current implementation leaks the NautilusFileUndoManager instance, because the code does not unref it anywhere. This commit adds a _new() function to the undo manager and makes NautilusApplication manage its lifetime.
Created attachment 332100 [details] [review] file-undo-manager: initialize singleton explicitly The current implementation leaks the NautilusFileUndoManager instance, because the code does not unref it anywhere. This commit adds a _new() function to the undo manager and makes NautilusApplication manage its lifetime.
Created attachment 332101 [details] [review] file-undo-manager: initialize singleton explicitly The current implementation leaks the NautilusFileUndoManager instance, because the code does not unref it anywhere. This commit adds a _new() function to the undo manager and makes NautilusApplication manage its lifetime.
Review of attachment 332101 [details] [review]: As discussed on IRC. LGTM thanks!!!
Attachment 332101 [details] pushed as bcf88a7 - file-undo-manager: initialize singleton explicitly