diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-10-06 02:27:42 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-10-06 02:27:42 +0200 |
commit | a0cbf72827b87a28fba47988957001a8b4fbddf5 (patch) | |
tree | 8cbeb6b8a32eedb154f956266008fb899ad6a1ee | |
parent | 7b11798a67270471ac2fe39690a36b881d9f33f9 (diff) | |
download | nautilus-a0cbf72827b87a28fba47988957001a8b4fbddf5.tar.gz |
window-menus: unref extension created action
This looks not very harmful. But definitely is.
Thing is, when using nautilus_action_from_menu_item it keeps
a reference to the NautilusMenuItem from the extension.
So that menu item will never be freed.
Now, let's imagine nautilus-open-terminal have a ref to the file
that the item points to, and only unref it when the item is destroyed.
Now, sum that when a file is not unrefed completely from nautilus
when unmounting the file, so it's mark as gone and cannot be used again.
Now try to use it in this state. Nautilus crashes.
This fix few crashes reported downstream on distros that uses
this extension.
-rw-r--r-- | src/nautilus-window-menus.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c index 999d1630c..32aba4af0 100644 --- a/src/nautilus-window-menus.c +++ b/src/nautilus-window-menus.c @@ -685,6 +685,8 @@ add_extension_menu_items (NautilusWindow *window, nautilus_menu_item_list_free (children); g_free (subdir); } + + g_object_unref (action); } } |