[Rawstudio-commit] r2205 - trunk/plugins/input-image16

Anders Brander anders at brander.dk
Fri Feb 20 12:12:13 CET 2009


Author: abrander
Date: 2009-02-20 12:12:12 +0100 (Fri, 20 Feb 2009)
New Revision: 2205

Modified:
   trunk/plugins/input-image16/input-image16.c
Log:
Stop RSInputImage16 from leaking refs.

Modified: trunk/plugins/input-image16/input-image16.c
===================================================================
--- trunk/plugins/input-image16/input-image16.c	2009-02-18 22:34:46 UTC (rev 2204)
+++ trunk/plugins/input-image16/input-image16.c	2009-02-20 11:12:12 UTC (rev 2205)
@@ -50,6 +50,7 @@
 static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
 static RS_IMAGE16 *get_image(RSFilter *filter);
+static void dispose (GObject *object);
 static gint get_width(RSFilter *filter);
 static gint get_height(RSFilter *filter);
 static void image_changed(RS_IMAGE16 *image, RSInputImage16 *input_image16);
@@ -73,6 +74,7 @@
 
 	object_class->get_property = get_property;
 	object_class->set_property = set_property;
+	object_class->dispose = dispose;
 
 	g_object_class_install_property(object_class,
 		PROP_IMAGE, g_param_spec_object (
@@ -130,6 +132,18 @@
 	}
 }
 
+static void
+dispose (GObject *object)
+{
+	RSInputImage16 *input_image16 = RS_INPUT_IMAGE16(object);
+
+	if (input_image16->image)
+		g_object_unref(input_image16->image);
+
+	/* Chain up */
+	G_OBJECT_CLASS (rs_input_image16_parent_class)->dispose (object);
+}
+
 static RS_IMAGE16 *
 get_image(RSFilter *filter)
 {




More information about the Rawstudio-commit mailing list