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 769808 - Fix file list leaks
Fix file list leaks
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-08-12 17:19 UTC by Ernestas Kulik
Modified: 2016-08-21 16:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix file list leaks (3.32 KB, patch)
2016-08-12 17:19 UTC, Ernestas Kulik
none Details | Review
Fix file list leaks (3.32 KB, patch)
2016-08-12 17:20 UTC, Ernestas Kulik
needs-work Details | Review
files-view: free file lists after use (2.54 KB, patch)
2016-08-21 08:23 UTC, Ernestas Kulik
committed Details | Review

Description Ernestas Kulik 2016-08-12 17:19:30 UTC
After these changes, gobject-list reports no NautilusVFSFile leaks. I have also not encountered any crashes, so it must be good. :)
Comment 1 Ernestas Kulik 2016-08-12 17:19:36 UTC
Created attachment 333190 [details] [review]
Fix file list leaks

Some functions call acquire file lists, but do not free them after use.
This commit plugs the leaks.
Comment 2 Ernestas Kulik 2016-08-12 17:20:37 UTC
Created attachment 333191 [details] [review]
Fix file list leaks

Some functions acquire file lists, but do not free them after use.
This commit plugs the leaks.
Comment 3 Carlos Soriano 2016-08-20 19:02:55 UTC
Review of attachment 333191 [details] [review]:

::: src/nautilus-window-slot.c
@@ +989,3 @@
 	priv->location_change_distance = distance;
 	priv->tried_mount = FALSE;
+	priv->pending_selection = new_selection;

this is wrong from a code design perspective, you need to make sure this keeps alive because you will need it more than just for the function live scope. Actually they are freed on the caller, which would make this crash.
Comment 4 Carlos Soriano 2016-08-20 19:02:56 UTC
Review of attachment 333191 [details] [review]:

::: src/nautilus-window-slot.c
@@ +989,3 @@
 	priv->location_change_distance = distance;
 	priv->tried_mount = FALSE;
+	priv->pending_selection = new_selection;

this is wrong from a code design perspective, you need to make sure this keeps alive because you will need it more than just for the function live scope. Actually they are freed on the caller, which would make this crash.
Comment 5 Ernestas Kulik 2016-08-21 08:23:52 UTC
Created attachment 333783 [details] [review]
files-view: free file lists after use

Some functions acquire file lists, but do not free them after use or
erroneously acquire them twice. This commit plugs the leaks.
Comment 6 Carlos Soriano 2016-08-21 13:52:09 UTC
Review of attachment 333783 [details] [review]:

+1 thanks!!!
Comment 7 Ernestas Kulik 2016-08-21 16:45:04 UTC
Attachment 333783 [details] pushed as dd0539f - files-view: free file lists after use