From 59cb3c4529c5a8827d976179a1f4d1777852aea1 Mon Sep 17 00:00:00 2001 From: Gary Li Date: Fri, 10 Mar 2023 23:02:09 -0500 Subject: application: Take reference of GFile location when cloning window Nautilus crashes under d45b820d when we open a second window and in both windows navigate to a common new location. This is caused by incorrect reference management in action_clone_window, where neither nautilus_window_slot_get_location nor nautilus_window_slot_get_pending_location increases the ref count of the GFile location. g_autoptr would cause location to be prematurely freed. Take the reference of location to allow g_autoptr to work correctly for all branches of action_clone_window. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2858 --- src/nautilus-application.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nautilus-application.c b/src/nautilus-application.c index 1dabb1802..3822ebb84 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -728,6 +728,7 @@ action_clone_window (GSimpleAction *action, { location = nautilus_window_slot_get_pending_location (active_slot); } + g_object_ref (location); } nautilus_application_open_location_full (NAUTILUS_APPLICATION (application), location, -- cgit v1.2.1