Blame SOURCES/window-menus-unref-extension-created-action.patch

0d1f52
From a0cbf72827b87a28fba47988957001a8b4fbddf5 Mon Sep 17 00:00:00 2001
0d1f52
From: Carlos Soriano <csoriano@gnome.org>
0d1f52
Date: Tue, 6 Oct 2015 02:27:42 +0200
0d1f52
Subject: [PATCH] window-menus: unref extension created action
0d1f52
0d1f52
This looks not very harmful. But definitely is.
0d1f52
Thing is, when using nautilus_action_from_menu_item it keeps
0d1f52
a reference to the NautilusMenuItem from the extension.
0d1f52
So that menu item will never be freed.
0d1f52
Now, let's imagine nautilus-open-terminal have a ref to the file
0d1f52
that the item points to, and only unref it when the item is destroyed.
0d1f52
Now, sum that when a file is not unrefed completely from nautilus
0d1f52
when unmounting the file, so it's mark as gone and cannot be used again.
0d1f52
Now try to use it in this state. Nautilus crashes.
0d1f52
0d1f52
This fix few crashes reported downstream on distros that uses
0d1f52
this extension.
0d1f52
---
0d1f52
 src/nautilus-window-menus.c | 2 ++
0d1f52
 1 file changed, 2 insertions(+)
0d1f52
0d1f52
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
0d1f52
index 999d163..32aba4a 100644
0d1f52
--- a/src/nautilus-window-menus.c
0d1f52
+++ b/src/nautilus-window-menus.c
0d1f52
@@ -685,6 +685,8 @@ add_extension_menu_items (NautilusWindow *window,
0d1f52
 			nautilus_menu_item_list_free (children);
0d1f52
 			g_free (subdir);
0d1f52
 		}			
0d1f52
+
0d1f52
+                g_object_unref (action);
0d1f52
 	}
0d1f52
 }
0d1f52
 
0d1f52
-- 
0d1f52
2.5.0
0d1f52