summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacy KuchciƄski <ignacykuchcinski@gmail.com>2022-08-22 10:36:42 +0200
committerCorey Berla <corey@berla.me>2022-09-01 08:19:45 -0700
commit0588ce739a81d646923884b9c6b87f6d58f07747 (patch)
tree489f077794496b427116a4942ad819dbd68893c6
parentb1d9bf21095cbcf015b0e24d9e93959177e42671 (diff)
downloadnautilus-0588ce739a81d646923884b9c6b87f6d58f07747.tar.gz
toolbar: Don't add a ref to menu_item
g_set_object adds a ref, so don't use it in this case
-rw-r--r--src/nautilus-toolbar.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index 5fe4e63a4..d4bec3cac 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -748,7 +748,8 @@ undo_manager_changed (NautilusToolbar *self)
g_autofree gchar *redo_description = NULL;
gboolean is_undo;
g_autoptr (GMenu) updated_section = g_menu_new ();
- g_autoptr (GMenuItem) menu_item = NULL;
+ g_autoptr (GMenuItem) undo_menu_item = NULL;
+ g_autoptr (GMenuItem) redo_menu_item = NULL;
/* Look up the last action from the undo manager, and get the text that
* describes it, e.g. "Undo Create Folder"/"Redo Create Folder"
@@ -776,8 +777,8 @@ undo_manager_changed (NautilusToolbar *self)
g_free (undo_label);
undo_label = g_strdup (_("_Undo"));
}
- g_set_object (&menu_item, g_menu_item_new (undo_label, "win.undo"));
- g_menu_append_item (updated_section, menu_item);
+ undo_menu_item = g_menu_item_new (undo_label, "win.undo");
+ g_menu_append_item (updated_section, undo_menu_item);
update_action (self, "undo", undo_active);
if (!redo_active || redo_label == NULL)
@@ -785,8 +786,8 @@ undo_manager_changed (NautilusToolbar *self)
g_free (redo_label);
redo_label = g_strdup (_("_Redo"));
}
- g_set_object (&menu_item, g_menu_item_new (redo_label, "win.redo"));
- g_menu_append_item (updated_section, menu_item);
+ redo_menu_item = g_menu_item_new (redo_label, "win.redo");
+ g_menu_append_item (updated_section, redo_menu_item);
update_action (self, "redo", redo_active);
nautilus_gmenu_set_from_model (G_MENU (self->undo_redo_section),