[gimp/gimp-2-8] libgimpwidgets: Disconnect ruler's idle handler in dispose



commit 978a394efec664da104b8e255eebd794d81095bc
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sun Sep 6 17:41:09 2015 -0400

    libgimpwidgets: Disconnect ruler's idle handler in dispose
    
    As discussed on irc, this is more appropriate than finalize because
    we shouldn't be making any gtk calls after dispose.
    
    (cherry picked from commit 8c02b360fb1a69d68b8c4cb2b1c5f7820c3f1640)

 libgimpwidgets/gimpruler.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
---
diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c
index c9c1e85..305a6b3 100644
--- a/libgimpwidgets/gimpruler.c
+++ b/libgimpwidgets/gimpruler.c
@@ -95,7 +95,6 @@ static const struct
 
 
 static void          gimp_ruler_dispose              (GObject        *object);
-static void          gimp_ruler_finalize             (GObject        *object);
 static void          gimp_ruler_set_property         (GObject        *object,
                                                       guint           prop_id,
                                                       const GValue   *value,
@@ -145,7 +144,6 @@ gimp_ruler_class_init (GimpRulerClass *klass)
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   object_class->dispose             = gimp_ruler_dispose;
-  object_class->finalize            = gimp_ruler_finalize;
   object_class->set_property        = gimp_ruler_set_property;
   object_class->get_property        = gimp_ruler_get_property;
 
@@ -263,22 +261,13 @@ gimp_ruler_dispose (GObject *object)
   while (priv->track_widgets)
     gimp_ruler_remove_track_widget (ruler, priv->track_widgets->data);
 
-  G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-gimp_ruler_finalize (GObject *object)
-{
-  GimpRuler        *ruler = GIMP_RULER (object);
-  GimpRulerPrivate *priv  = GIMP_RULER_GET_PRIVATE (ruler);
-
   if (priv->pos_redraw_idle_id)
     {
       g_source_remove (priv->pos_redraw_idle_id);
       priv->pos_redraw_idle_id = 0;
     }
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 static void


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