Commit 33202b9c authored by Rui Matos's avatar Rui Matos Committed by Bastien Nocera
Browse files

privacy: Don't leak the dialogs

https://bugzilla.gnome.org/show_bug.cgi?id=708286
parent b17bd4ea
......@@ -38,6 +38,9 @@ CC_PANEL_REGISTER (CcPrivacyPanel, cc_privacy_panel)
struct _CcPrivacyPanelPrivate
{
GtkBuilder *builder;
GtkWidget *recent_dialog;
GtkWidget *screen_lock_dialog;
GtkWidget *trash_dialog;
GtkWidget *list_box;
GSettings *lockdown_settings;
......@@ -245,7 +248,7 @@ add_screen_lock (CcPrivacyPanel *self)
add_row (self, _("Screen Lock"), "screen_lock_dialog", w);
w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "screen_lock_done"));
dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "screen_lock_dialog"));
dialog = self->priv->screen_lock_dialog;
g_signal_connect_swapped (w, "clicked",
G_CALLBACK (gtk_widget_hide), dialog);
g_signal_connect (dialog, "delete-event",
......@@ -358,7 +361,7 @@ add_usage_history (CcPrivacyPanel *self)
add_row (self, _("Usage & History"), "recent_dialog", w);
w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "recent_done"));
dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "recent_dialog"));
dialog = self->priv->recent_dialog;
g_signal_connect_swapped (w, "clicked",
G_CALLBACK (gtk_widget_hide), dialog);
g_signal_connect (dialog, "delete-event",
......@@ -535,7 +538,7 @@ add_trash_temp (CcPrivacyPanel *self)
add_row (self, _("Purge Trash & Temporary Files"), "trash_dialog", w);
w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "trash_done"));
dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "trash_dialog"));
dialog = self->priv->trash_dialog;
g_signal_connect_swapped (w, "clicked",
G_CALLBACK (gtk_widget_hide), dialog);
g_signal_connect (dialog, "delete-event",
......@@ -569,6 +572,9 @@ cc_privacy_panel_finalize (GObject *object)
{
CcPrivacyPanelPrivate *priv = CC_PRIVACY_PANEL (object)->priv;
g_clear_pointer (&priv->recent_dialog, gtk_widget_destroy);
g_clear_pointer (&priv->screen_lock_dialog, gtk_widget_destroy);
g_clear_pointer (&priv->trash_dialog, gtk_widget_destroy);
g_clear_object (&priv->builder);
g_clear_object (&priv->lockdown_settings);
g_clear_object (&priv->lock_settings);
......@@ -651,6 +657,10 @@ cc_privacy_panel_init (CcPrivacyPanel *self)
return;
}
self->priv->recent_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "recent_dialog"));
self->priv->screen_lock_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "screen_lock_dialog"));
self->priv->trash_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "trash_dialog"));
frame = WID ("frame");
widget = gtk_list_box_new ();
gtk_list_box_set_selection_mode (GTK_LIST_BOX (widget), GTK_SELECTION_NONE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment