[gnome-control-center] Revert "datetime: Don't leak the dialogs"
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Revert "datetime: Don't leak the dialogs"
- Date: Mon, 7 Oct 2013 10:53:11 +0000 (UTC)
commit 47fb0c426ff746a3d4f05060006738c6ca068570
Author: Kalev Lember <kalevlember gmail com>
Date: Fri Oct 4 18:28:50 2013 +0200
Revert "datetime: Don't leak the dialogs"
This caused criticals when on_permission_changed callback tried to
access priv->datetime_dialog or priv->timezone_dialog before they had
been set up.
Another attempt at fixing the leak in the following patch.
This reverts commit 545c8865434314739d86df6a656a2461e7d1b609.
https://bugzilla.gnome.org/show_bug.cgi?id=709443
panels/datetime/cc-datetime-panel.c | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 3392ae2..2e1a0a2 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -71,9 +71,6 @@ struct _CcDateTimePanelPrivate
GtkBuilder *builder;
GtkWidget *map;
- GtkWidget *datetime_dialog;
- GtkWidget *timezone_dialog;
-
GList *listboxes;
GList *listboxes_reverse;
@@ -160,9 +157,6 @@ cc_date_time_panel_dispose (GObject *object)
g_clear_pointer (&priv->listboxes, g_list_free);
g_clear_pointer (&priv->listboxes_reverse, g_list_free);
- g_clear_pointer (&priv->datetime_dialog, gtk_widget_destroy);
- g_clear_pointer (&priv->timezone_dialog, gtk_widget_destroy);
-
G_OBJECT_CLASS (cc_date_time_panel_parent_class)->dispose (object);
}
@@ -790,8 +784,8 @@ on_permission_changed (GPermission *permission,
/* Hide the subdialogs if we no longer have permissions */
if (!allowed)
{
- gtk_widget_hide (priv->datetime_dialog);
- gtk_widget_hide (priv->timezone_dialog);
+ gtk_widget_hide (GTK_WIDGET (W ("datetime-dialog")));
+ gtk_widget_hide (GTK_WIDGET (W ("timezone-dialog")));
}
}
@@ -1052,7 +1046,7 @@ format_hours_combobox (GtkSpinButton *spin,
return TRUE;
}
-static GtkWidget *
+static void
setup_timezone_dialog (CcDateTimePanel *self)
{
CcDateTimePanelPrivate *priv = self->priv;
@@ -1087,8 +1081,6 @@ setup_timezone_dialog (CcDateTimePanel *self)
gtk_entry_completion_set_model (completion, completion_model);
gtk_entry_completion_set_text_column (completion, CITY_COL_CITY_HUMAN_READABLE);
-
- return dialog;
}
static char *
@@ -1162,7 +1154,7 @@ setup_am_pm_button (CcDateTimePanel *self)
g_object_unref (provider);
}
-static GtkWidget *
+static void
setup_datetime_dialog (CcDateTimePanel *self)
{
CcDateTimePanelPrivate *priv = self->priv;
@@ -1239,8 +1231,6 @@ setup_datetime_dialog (CcDateTimePanel *self)
G_CALLBACK (change_time), self);
g_signal_connect_swapped (W ("m_spinbutton"), "value-changed",
G_CALLBACK (change_time), self);
-
- return dialog;
}
static void
@@ -1299,8 +1289,8 @@ cc_date_time_panel_init (CcDateTimePanel *self)
priv->date = g_date_time_new_now_local ();
- priv->timezone_dialog = setup_timezone_dialog (self);
- priv->datetime_dialog = setup_datetime_dialog (self);
+ setup_timezone_dialog (self);
+ setup_datetime_dialog (self);
setup_listbox (self, W ("listbox1"));
setup_listbox (self, W ("listbox2"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]