After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769082 - Fix NautilusFileUndoManager leak
Fix NautilusFileUndoManager leak
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-22 13:34 UTC by Ernestas Kulik
Modified: 2016-07-25 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-undo-manager: add file_undo_manager_destroy() (1.41 KB, patch)
2016-07-22 13:34 UTC, Ernestas Kulik
none Details | Review
application: destroy file undo manager on shutdown (1.10 KB, patch)
2016-07-22 13:34 UTC, Ernestas Kulik
none Details | Review
file-undo-manager: add file_undo_manager_unref() (1.41 KB, patch)
2016-07-22 13:46 UTC, Ernestas Kulik
none Details | Review
application: unref file undo manager on shutdown (1.09 KB, patch)
2016-07-22 13:46 UTC, Ernestas Kulik
none Details | Review
file-undo-manager: initialize singleton explicitly (5.67 KB, patch)
2016-07-25 11:45 UTC, Ernestas Kulik
none Details | Review
file-undo-manager: initialize singleton explicitly (5.67 KB, patch)
2016-07-25 12:11 UTC, Ernestas Kulik
none Details | Review
file-undo-manager: initialize singleton explicitly (6.02 KB, patch)
2016-07-25 12:14 UTC, Ernestas Kulik
committed Details | Review

Description Ernestas Kulik 2016-07-22 13:34:49 UTC
See patches.
Comment 1 Ernestas Kulik 2016-07-22 13:34:54 UTC
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.
Comment 2 Ernestas Kulik 2016-07-22 13:34:59 UTC
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.
Comment 3 Ernestas Kulik 2016-07-22 13:46:46 UTC
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.
Comment 4 Ernestas Kulik 2016-07-22 13:46:56 UTC
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.
Comment 5 Ernestas Kulik 2016-07-22 13:49:23 UTC
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.
Comment 6 Ernestas Kulik 2016-07-25 11:45:56 UTC
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.
Comment 7 Ernestas Kulik 2016-07-25 12:11:07 UTC
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.
Comment 8 Ernestas Kulik 2016-07-25 12:14:02 UTC
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.
Comment 9 Carlos Soriano 2016-07-25 12:18:13 UTC
Review of attachment 332101 [details] [review]:

As discussed on IRC.

LGTM thanks!!!
Comment 10 Ernestas Kulik 2016-07-25 12:22:00 UTC
Attachment 332101 [details] pushed as bcf88a7 - file-undo-manager: initialize singleton explicitly