summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Webster <[email protected]>2021-05-16 19:35:34 -0400
committerraveit65 <[email protected]>2022-07-21 19:33:51 +0200
commitfdb1a1d7b52b5df579e70533ded03322d4440e8e (patch)
tree0a47c3388c0c852e1a332c37e98c2c8bf7072a00
parent07edc174c46d103fd5c662071523fa15986b8c27 (diff)
downloadcaja-fdb1a1d7b52b5df579e70533ded03322d4440e8e.tar.bz2
caja-fdb1a1d7b52b5df579e70533ded03322d4440e8e.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 f097ea59..dbdde3c2 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);
}