summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Webster <[email protected]>2021-05-16 19:35:34 -0400
committerLuke from DC <[email protected]>2021-05-19 19:15:53 +0000
commit6a3dbb0cdcc2c8c3ebfc06f6b4a562bf54a9a7b7 (patch)
tree0a852440e6ca2eea4de25985a6671feff2b0b6b7
parent46e02ca4209c30a73d0999d6e6395cb17a5de971 (diff)
downloadcaja-6a3dbb0cdcc2c8c3ebfc06f6b4a562bf54a9a7b7.tar.bz2
caja-6a3dbb0cdcc2c8c3ebfc06f6b4a562bf54a9a7b7.tar.xz
caja-directory.c: Fix memory leak.
When creating a new file (using a template, for instance), file-> details->is_added could potentially be FALSE, and cause this file to not be finalized along with other files if the view directory is destroyed. This can cause issues when re-entering that directory, with the file being in an undefined state, and could prevent the view from fully loading the location (this is identical behavior to that described in https://github.com/mate-desktop/python-caja/pull/64. To reproduce: - Create an svg file and save in ~/Templates. - Right-click, Create document-> svg file, name it whatever. - Navigate out of the folder. - Modify the file in a visible manner. - Re-enter the folder, note that it never finishes loading. Ref: https://github.com/linuxmint/nemo/issues/2736
-rw-r--r--libcaja-private/caja-directory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcaja-private/caja-directory.c b/libcaja-private/caja-directory.c
index 8b315e00..1bb1518b 100644
--- a/libcaja-private/caja-directory.c
+++ b/libcaja-private/caja-directory.c
@@ -923,7 +923,6 @@ caja_directory_notify_files_added (GList *files)
* If it was renamed this could be ignored, but
* queue a change just in case */
caja_file_changed (file);
- caja_file_unref (file);
}
else
{
@@ -931,6 +930,7 @@ caja_directory_notify_files_added (GList *files)
directory,
g_object_ref (location));
}
+ caja_file_unref (file);
caja_directory_unref (directory);
}