]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktreeselection.c
added compile time switch to put the tree views into a hpaned for owen to
[~andy/gtk] / gtk / gtktreeselection.c
index 6b67452bc6df5b401e4d9d37582c032174113ee5..2c93cd43509f7b3f2b8cc2a061998b8b698f14db 100644 (file)
@@ -98,8 +98,15 @@ gtk_tree_selection_init (GtkTreeSelection *selection)
 static void
 gtk_tree_selection_finalize (GObject *object)
 {
-  if (GTK_TREE_SELECTION (object)->destroy)
-    (* GTK_TREE_SELECTION (object)->destroy) (GTK_TREE_SELECTION (object)->user_data);
+  GtkTreeSelection *selection = GTK_TREE_SELECTION (object);
+
+  if (selection->destroy)
+    {
+      GtkDestroyNotify d = selection->destroy;
+
+      selection->destroy = NULL;
+      d (selection->user_data);
+    }
 
   /* chain parent_class' handler */
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -276,6 +283,14 @@ gtk_tree_selection_set_select_function (GtkTreeSelection     *selection,
   g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
   g_return_if_fail (func != NULL);
 
+  if (selection->destroy)
+    {
+      GtkDestroyNotify d = selection->destroy;
+
+      selection->destroy = NULL;
+      d (selection->user_data);
+    }
+
   selection->user_func = func;
   selection->user_data = data;
   selection->destroy = destroy;