[gtk+] gtkplacessidebar: clean up trash row on destroy
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkplacessidebar: clean up trash row on destroy
- Date: Fri, 26 Feb 2016 10:54:05 +0000 (UTC)
commit 377ac909b7919a12109b4dfb0877589afbbd5a46
Author: Carlos Soriano <csoriano gnome org>
Date: Fri Feb 26 11:01:38 2016 +0100
gtkplacessidebar: clean up trash row on destroy
Track with a weak ref the trash row, so we can clean up the data in the
private struct.
Spotted and reviewed by Christian Hergert.
gtk/gtkplacessidebar.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index ba8d3c0..6160504 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -994,6 +994,7 @@ update_places (GtkPlacesSidebar *sidebar)
_("Trash"), icon, mount_uri,
NULL, NULL, NULL, 0,
_("Open the trash"));
+ g_object_add_weak_pointer (G_OBJECT (sidebar->trash_row), &sidebar->trash_row);
g_object_unref (icon);
}
@@ -4041,6 +4042,12 @@ gtk_places_sidebar_dispose (GObject *object)
g_clear_object (&sidebar->trash_monitor);
}
+ if (sidebar->trash_row)
+ {
+ g_object_remove_weak_pointer (G_OBJECT (sidebar->trash_row), &sidebar->trash_row);
+ sidebar->trash_row = NULL;
+ }
+
if (sidebar->volume_monitor != NULL)
{
g_signal_handlers_disconnect_by_func (sidebar->volume_monitor,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]