places sidebar: Fix memory handling of rename popover

We were freeing the same string twice here, leading to
badness.
This commit is contained in:
Matthias Clasen 2015-07-04 22:32:06 -04:00
parent 94bcdd3217
commit 8b90c79037

View File

@ -2435,7 +2435,7 @@ show_rename_popover (GtkSidebarRow *row)
if (sidebar->rename_uri)
g_free (sidebar->rename_uri);
sidebar->rename_uri = uri;
sidebar->rename_uri = g_strdup (uri);
gtk_entry_set_text (GTK_ENTRY (sidebar->rename_entry), name);
gtk_popover_set_relative_to (GTK_POPOVER (sidebar->rename_popover), GTK_WIDGET (row));
@ -3942,6 +3942,15 @@ gtk_places_sidebar_dispose (GObject *object)
sidebar->popup_menu = NULL;
}
if (sidebar->rename_popover)
{
gtk_widget_destroy (sidebar->rename_popover);
sidebar->rename_popover = NULL;
sidebar->rename_entry = NULL;
sidebar->rename_button = NULL;
sidebar->rename_error = NULL;
}
if (sidebar->trash_monitor)
{
g_signal_handler_disconnect (sidebar->trash_monitor, sidebar->trash_monitor_changed_id);