[gnome-control-center] datetime: Explicitly destroy toplevel dialogs



commit 24faa84d050acaf6f22f0a4229a183428743f6ee
Author: Kalev Lember <kalevlember gmail com>
Date:   Fri Oct 4 18:32:54 2013 +0200

    datetime: Explicitly destroy toplevel dialogs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709443

 panels/datetime/cc-datetime-panel.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 2e1a0a2..45ba352 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -73,6 +73,7 @@ struct _CcDateTimePanelPrivate
 
   GList *listboxes;
   GList *listboxes_reverse;
+  GList *toplevels;
 
   TzLocation *current_location;
 
@@ -145,6 +146,12 @@ cc_date_time_panel_dispose (GObject *object)
       priv->am_pm_visiblity_changed_id = 0;
     }
 
+  if (priv->toplevels)
+    {
+      g_list_free_full (priv->toplevels, (GDestroyNotify) gtk_widget_destroy);
+      priv->toplevels = NULL;
+    }
+
   g_clear_object (&priv->builder);
   g_clear_object (&priv->clock_tracker);
   g_clear_object (&priv->dtm);
@@ -1289,6 +1296,10 @@ cc_date_time_panel_init (CcDateTimePanel *self)
 
   priv->date = g_date_time_new_now_local ();
 
+  /* Top level windows from GtkBuilder that need to be destroyed explicitly */
+  priv->toplevels = g_list_append (priv->toplevels, W ("datetime-dialog"));
+  priv->toplevels = g_list_append (priv->toplevels, W ("timezone-dialog"));
+
   setup_timezone_dialog (self);
   setup_datetime_dialog (self);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]