[gimp/metadata-browser] libgimpwidgets: set GimpColorSelector's config to NULL in dispose()



commit 61a0cd76728afe6a65b738eaa843b5ddfa0bd2c3
Author: Michael Natterer <mitch gimp org>
Date:   Sun Dec 11 02:43:14 2011 +0100

    libgimpwidgets: set GimpColorSelector's config to NULL in dispose()
    
    so the subclasses have a chance to release their stuff.

 libgimpwidgets/gimpcolorselector.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libgimpwidgets/gimpcolorselector.c b/libgimpwidgets/gimpcolorselector.c
index d285b63..27d408c 100644
--- a/libgimpwidgets/gimpcolorselector.c
+++ b/libgimpwidgets/gimpcolorselector.c
@@ -55,6 +55,9 @@ enum
 };
 
 
+static void   gimp_color_selector_dispose (GObject *object);
+
+
 G_DEFINE_TYPE (GimpColorSelector, gimp_color_selector, GTK_TYPE_BOX)
 
 #define parent_class gimp_color_selector_parent_class
@@ -65,6 +68,10 @@ static guint selector_signals[LAST_SIGNAL] = { 0 };
 static void
 gimp_color_selector_class_init (GimpColorSelectorClass *klass)
 {
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->dispose = gimp_color_selector_dispose;
+
   selector_signals[COLOR_CHANGED] =
     g_signal_new ("color-changed",
                   G_TYPE_FROM_CLASS (klass),
@@ -116,6 +123,14 @@ gimp_color_selector_init (GimpColorSelector *selector)
   selector->channel = GIMP_COLOR_SELECTOR_HUE;
 }
 
+static void
+gimp_color_selector_dispose (GObject *object)
+{
+  gimp_color_selector_set_config (GIMP_COLOR_SELECTOR (object), NULL);
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
 GtkWidget *
 gimp_color_selector_new (GType                     selector_type,
                          const GimpRGB            *rgb,



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