[gnome-initial-setup] cc-notebook: Make sure to clean up if the widget gets destroyed
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] cc-notebook: Make sure to clean up if the widget gets destroyed
- Date: Tue, 21 Aug 2012 19:36:56 +0000 (UTC)
commit 88ef20c84e3bab0262b1ddbcf8f342880ac716e3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Aug 21 15:05:02 2012 -0400
cc-notebook: Make sure to clean up if the widget gets destroyed
gnome-initial-setup/cc-notebook.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gnome-initial-setup/cc-notebook.c b/gnome-initial-setup/cc-notebook.c
index ac7ffd8..8de082c 100644
--- a/gnome-initial-setup/cc-notebook.c
+++ b/gnome-initial-setup/cc-notebook.c
@@ -443,6 +443,14 @@ cc_notebook_select_page (CcNotebook *self,
g_warning ("Could not find widget '%p' in CcNotebook '%p'", widget, self);
}
+static void
+widget_destroyed (GtkWidget *widget,
+ gpointer user_data)
+{
+ CcNotebook *notebook = g_object_get_data (G_OBJECT (widget), "cc-notebook");
+ cc_notebook_remove_page (notebook, widget);
+}
+
void
cc_notebook_add_page (CcNotebook *self,
GtkWidget *widget)
@@ -460,6 +468,8 @@ cc_notebook_add_page (CcNotebook *self,
embed = gtk_clutter_actor_new_with_contents (widget);
g_object_set_data (G_OBJECT (widget), "cc-notebook-frame", frame);
+ g_object_set_data (G_OBJECT (widget), "cc-notebook", self);
+ g_signal_connect (widget, "destroy", G_CALLBACK (widget_destroyed), NULL);
clutter_actor_add_child (frame, embed);
gtk_widget_show (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]