[gnome-control-center/gnome-3-4] wacom: Destroy button mapping dialogue on unplug



commit 280aea1181a85e2c3bb4085f4cab6800b4c3137a
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 25 11:19:37 2012 +0100

    wacom: Destroy button mapping dialogue on unplug
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676790

 panels/wacom/cc-wacom-page.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/panels/wacom/cc-wacom-page.c b/panels/wacom/cc-wacom-page.c
index e9f17e4..f8c1910 100644
--- a/panels/wacom/cc-wacom-page.c
+++ b/panels/wacom/cc-wacom-page.c
@@ -69,6 +69,7 @@ struct _CcWacomPagePrivate
 
 	/* Button mapping */
 	GtkBuilder     *mapping_builder;
+	GtkWidget      *button_map;
 
 	/* Display mapping */
 	GtkWidget      *mapping;
@@ -653,6 +654,9 @@ map_buttons_button_clicked_cb (GtkButton   *button,
 			  G_CALLBACK (button_mapping_dialog_closed), page);
 
 	gtk_widget_show (dialog);
+
+	priv->button_map = dialog;
+	g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *) &priv->button_map);
 }
 
 static void
@@ -806,6 +810,11 @@ cc_wacom_page_dispose (GObject *object)
 		priv->area = NULL;
 	}
 
+	if (priv->button_map) {
+		gtk_widget_destroy (priv->button_map);
+		priv->button_map = NULL;
+	}
+
 	if (priv->builder) {
 		g_object_unref (priv->builder);
 		priv->builder = NULL;



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