summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2015-01-25 17:10:53 +0000
committerCosimo Cecchi <cosimoc@gnome.org>2015-01-26 11:19:22 +0000
commitb20990b1eb4d1d4636d409f3235133358994059a (patch)
tree4ed4fdbc6c21693f69fedabe0eab1ab662274507
parent2311e8790fc2eac3e8288bc368d9ad841cfca813 (diff)
downloadnautilus-b20990b1eb4d1d4636d409f3235133358994059a.tar.gz
view: plug memory leaks
We were not freeing the strings coming from the undo manager.
-rw-r--r--src/nautilus-view.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 5d5ff9b35..7443f4ad6 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -6441,8 +6441,8 @@ real_update_toolbar_menus (NautilusView *view)
&redo_label, &redo_description);
}
- undo_label = undo_active ? undo_label : _("Undo");
- redo_label = redo_active ? redo_label : _("Redo");
+ undo_label = undo_active ? undo_label : g_strdup (_("Undo"));
+ redo_label = redo_active ? redo_label : g_strdup (_("Redo"));
undo_menu_item = g_menu_item_new (undo_label, "view.undo");
redo_menu_item = g_menu_item_new (redo_label, "view.redo");
nautilus_toolbar_action_menu_add_item (toolbar, undo_menu_item, "undo-redo-section");
@@ -6452,6 +6452,10 @@ real_update_toolbar_menus (NautilusView *view)
g_object_unref (undo_menu_item);
g_object_unref (redo_menu_item);
+ g_free (undo_label);
+ g_free (undo_description);
+ g_free (redo_label);
+ g_free (redo_description);
}
/* Convenience function to reset the menus owned by the but that are managed on