Author: abrander
Date: 2009-07-04 16:20:21 +0200 (Sat, 04 Jul 2009)
New Revision: 2528

Modified:
   trunk/plugins/cache/cache.c
Log:
Avoid leaking in RSCache.

Modified: trunk/plugins/cache/cache.c
===================================================================
--- trunk/plugins/cache/cache.c 2009-07-04 14:15:12 UTC (rev 2527)
+++ trunk/plugins/cache/cache.c 2009-07-04 14:20:21 UTC (rev 2528)
@@ -53,6 +53,7 @@
        PROP_IGNORE_ROI
 };
 
+static void finalize(GObject *object);
 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, RS_FILTER_PARAM *param);
@@ -74,6 +75,7 @@
 
        object_class->get_property = get_property;
        object_class->set_property = set_property;
+       object_class->finalize = finalize;
 
        g_object_class_install_property(object_class,
                PROP_LATENCY, g_param_spec_int(
@@ -106,6 +108,13 @@
 }
 
 static void
+finalize(GObject *object)
+{
+       RSCache *cache = RS_CACHE(object);
+       flush(cache);
+}
+
+static void
 get_property(GObject *object, guint property_id, GValue *value, GParamSpec 
*pspec)
 {
        RSCache *cache = RS_CACHE(object);


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to