[SCM] calf/master: Fix the same memory leak in the phase graph widget.

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:41:16 UTC 2013


The following commit has been merged in the master branch:
commit fa9ccb79e76a5c0b0924e42582c00a8589083b06
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Wed Sep 26 23:11:45 2012 +0100

    Fix the same memory leak in the phase graph widget.

diff --git a/src/custom_ctl.cpp b/src/custom_ctl.cpp
index 7bfc80e..edf2cdf 100644
--- a/src/custom_ctl.cpp
+++ b/src/custom_ctl.cpp
@@ -869,6 +869,17 @@ calf_phase_graph_class_init (CalfPhaseGraphClass *klass)
 }
 
 static void
+calf_phase_graph_unrealize (GtkWidget *widget, CalfPhaseGraph *pg)
+{
+    if( pg->cache_surface )
+        cairo_surface_destroy( pg->cache_surface );
+    pg->cache_surface = NULL;
+    if( pg->fade_surface )
+        cairo_surface_destroy( pg->fade_surface );
+    pg->fade_surface = NULL;
+}
+
+static void
 calf_phase_graph_init (CalfPhaseGraph *self)
 {
     GtkWidget *widget = GTK_WIDGET(self);
@@ -876,6 +887,7 @@ calf_phase_graph_init (CalfPhaseGraph *self)
     widget->requisition.height = 40;
     self->cache_surface = NULL;
     self->fade_surface = NULL;
+    gtk_signal_connect(GTK_OBJECT(widget), "unrealize", G_CALLBACK(calf_phase_graph_unrealize), (gpointer)self);
 }
 
 GtkWidget *

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list