[gnumeric] GUI: Plug leak.



commit 22147517dea4f5b3e0768e1bf6d69b8fad2815f8
Author: Morten Welinder <terra gnome org>
Date:   Mon Jan 5 21:00:40 2015 -0500

    GUI: Plug leak.

 src/widgets/ChangeLog                       |    5 +++++
 src/widgets/gnumeric-cell-renderer-toggle.c |   12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index fa8585c..c1aee57 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-05  Morten Welinder  <terra gnome org>
+
+       * gnumeric-cell-renderer-toggle.c
+       (gnumeric_cell_renderer_toggle_dispose): Plug leak.
+
 2015-01-01  Morten Welinder  <terra gnome org>
 
        * gnumeric-cell-renderer-text.c
diff --git a/src/widgets/gnumeric-cell-renderer-toggle.c b/src/widgets/gnumeric-cell-renderer-toggle.c
index 5225c00..a5e0b33 100644
--- a/src/widgets/gnumeric-cell-renderer-toggle.c
+++ b/src/widgets/gnumeric-cell-renderer-toggle.c
@@ -88,6 +88,14 @@ gnumeric_cell_renderer_toggle_get_type (void)
 }
 
 static void
+gnumeric_cell_renderer_toggle_dispose (GObject *obj)
+{
+       GnumericCellRendererToggle *celltoggle = GNUMERIC_CELL_RENDERER_TOGGLE (obj);
+       g_clear_object (&celltoggle->pixbuf);
+       G_OBJECT_CLASS (parent_class)->dispose (obj);
+}
+
+static void
 gnumeric_cell_renderer_toggle_class_init (GnumericCellRendererToggleClass *class)
 {
        GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS  (class);
@@ -97,6 +105,7 @@ gnumeric_cell_renderer_toggle_class_init (GnumericCellRendererToggleClass *class
 
        object_class->get_property = gnumeric_cell_renderer_toggle_get_property;
        object_class->set_property = gnumeric_cell_renderer_toggle_set_property;
+       object_class->dispose = gnumeric_cell_renderer_toggle_dispose;
 
        cell_class->render = gnumeric_cell_renderer_toggle_render;
        cell_class->get_size = gnumeric_cell_renderer_toggle_get_size;
@@ -127,8 +136,7 @@ gnumeric_cell_renderer_toggle_get_property (GObject     *object,
 
        switch (param_id) {
        case PROP_PIXBUF:
-               g_value_set_object (value,
-                                   celltoggle->pixbuf ? G_OBJECT (celltoggle->pixbuf) : NULL);
+               g_value_set_object (value, celltoggle->pixbuf);
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);


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