summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2022-10-22 22:10:10 +0000
committerAntónio Fernandes <antoniof@gnome.org>2022-12-04 15:24:25 +0000
commit16c0a9b102e99ec7aa3c880e034d8aa7b9c5b4f7 (patch)
tree9aa19ac4faa850dc0ba180ab7144cf8ebe4cb8df
parent23232ee60e940c1227b10122cd2e14fce2c8cd22 (diff)
downloadnautilus-16c0a9b102e99ec7aa3c880e034d8aa7b9c5b4f7.tar.gz
window-slot: Make ownership transfer of pending location explicit
-rw-r--r--src/nautilus-window-slot.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 170b2b4d1..210237146 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -2572,10 +2572,8 @@ nautilus_window_slot_show_special_location_bar (NautilusWindowSlot *self,
static void
nautilus_window_slot_update_for_new_location (NautilusWindowSlot *self)
{
- GFile *new_location;
+ g_autoptr (GFile) new_location = g_steal_pointer (&self->pending_location);
NautilusFile *file;
- new_location = self->pending_location;
- self->pending_location = NULL;
file = nautilus_file_get (new_location);
nautilus_window_slot_update_bookmark (self, file);
@@ -2592,7 +2590,6 @@ nautilus_window_slot_update_for_new_location (NautilusWindowSlot *self)
nautilus_window_slot_set_location (self, new_location);
- g_object_unref (new_location);
/* Sync the actions for this new location. */
nautilus_window_slot_sync_actions (self);