diff options
author | Gary Li <gary.li1@uwaterloo.ca> | 2023-03-10 23:02:09 -0500 |
---|---|---|
committer | Corey Berla <corey@berla.me> | 2023-04-20 13:44:55 +0000 |
commit | 59cb3c4529c5a8827d976179a1f4d1777852aea1 (patch) | |
tree | ae80d378939fda356321b8b677b0d24fb7772b24 | |
parent | 4b646bcd1de8b3d059ef78f9e00a590062906a10 (diff) | |
download | nautilus-59cb3c4529c5a8827d976179a1f4d1777852aea1.tar.gz |
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
-rw-r--r-- | src/nautilus-application.c | 1 |
1 files changed, 1 insertions, 0 deletions
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, |