]> Pileus Git - ~andy/gtk/commitdiff
Don't leak the tooltip object.
authorMorten Welinder <terra@gnome.org>
Wed, 17 Mar 2004 18:51:03 +0000 (18:51 +0000)
committerMorten Welinder <mortenw@src.gnome.org>
Wed, 17 Mar 2004 18:51:03 +0000 (18:51 +0000)
2004-03-17  Morten Welinder  <terra@gnome.org>

* tests/prop-editor.c (create_prop_editor): Don't leak the tooltip
object.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
tests/prop-editor.c

index c65f4976e3fb669d486300f49ff198d30d4af1b7..f20bb71c77c044e65c029c4c04c2c6edc25a8172 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * tests/prop-editor.c (create_prop_editor): Don't leak the tooltip
+       object.
+
        * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
        have no screen.  Fixes #137260.
        (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
index c65f4976e3fb669d486300f49ff198d30d4af1b7..f20bb71c77c044e65c029c4c04c2c6edc25a8172 100644 (file)
@@ -1,5 +1,8 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * tests/prop-editor.c (create_prop_editor): Don't leak the tooltip
+       object.
+
        * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
        have no screen.  Fixes #137260.
        (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
index c65f4976e3fb669d486300f49ff198d30d4af1b7..f20bb71c77c044e65c029c4c04c2c6edc25a8172 100644 (file)
@@ -1,5 +1,8 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * tests/prop-editor.c (create_prop_editor): Don't leak the tooltip
+       object.
+
        * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
        have no screen.  Fixes #137260.
        (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
index c65f4976e3fb669d486300f49ff198d30d4af1b7..f20bb71c77c044e65c029c4c04c2c6edc25a8172 100644 (file)
@@ -1,5 +1,8 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * tests/prop-editor.c (create_prop_editor): Don't leak the tooltip
+       object.
+
        * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
        have no screen.  Fixes #137260.
        (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
index c65f4976e3fb669d486300f49ff198d30d4af1b7..f20bb71c77c044e65c029c4c04c2c6edc25a8172 100644 (file)
@@ -1,5 +1,8 @@
 2004-03-17  Morten Welinder  <terra@gnome.org>
 
+       * tests/prop-editor.c (create_prop_editor): Don't leak the tooltip
+       object.
+
        * gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
        have no screen.  Fixes #137260.
        (shortcuts_add_bookmark_from_path): Simplify using check_is_folder
index 5d18c7d8ca0cd26bb09d1da613690c8fc7ceef7b..0dc055b3d9d755218584ed4d07e354ed66c66e14 100644 (file)
@@ -772,6 +772,12 @@ properties_from_type (GObject     *object,
   return sw;
 }
 
+static void
+kill_tips (GtkWindow *win, GtkObject *tips)
+{
+  gtk_object_destroy (tips);
+  g_object_unref (tips);
+}
 
 /* Pass zero for type if you want all properties */
 GtkWidget*
@@ -797,10 +803,13 @@ create_prop_editor (GObject   *object,
   if (GTK_IS_WIDGET (object))
     gtk_window_set_screen (GTK_WINDOW (win),
                           gtk_widget_get_screen (GTK_WIDGET (object)));
-  
+
   tips = gtk_tooltips_new ();
-  g_signal_connect_swapped (win, "destroy",
-                           G_CALLBACK (gtk_object_destroy), tips);
+  g_object_ref (tips);
+  gtk_object_sink (GTK_OBJECT (tips));
+
+  /* Kill the tips when the widget goes away.  */
+  g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (kill_tips), tips);
 
   /* hold a weak ref to the object we're editing */
   g_object_set_data_full (G_OBJECT (object), "prop-editor-win", win, model_destroy);