Hi,

i found a leak that was introduced after implementing caching. attached patch fix it.

--
________________________________________
Maksym Veremeyenko
>From f8bf2d60e96ffa932afca693fd97b97532ea9948 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1stereo.tv>
Date: Sun, 19 Apr 2015 03:32:27 +0200
Subject: [PATCH] fix leak in pango producer

---
 src/modules/gtk2/producer_pango.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/modules/gtk2/producer_pango.c b/src/modules/gtk2/producer_pango.c
index 48d5bc9..367cf1c 100644
--- a/src/modules/gtk2/producer_pango.c
+++ b/src/modules/gtk2/producer_pango.c
@@ -565,6 +565,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
 		// create cached image
 		if ( !cached )
 		{
+			uint8_t *buf_save;
 			int dst_stride, src_stride;
 
 			cached = mlt_pool_alloc( sizeof( struct pango_cached_image_s ));
@@ -579,6 +580,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
 
 			size = dst_stride * ( this->height + 1 );
 			buf = mlt_pool_alloc( size );
+			buf_save = buf;
 
 			if ( src_stride != dst_stride )
 			{
@@ -602,6 +604,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
 			{
 				frame->convert_image( frame, &buf, &cached->format, *format );
 				*format = cached->format;
+				if(buf != buf_save) mlt_pool_release(buf_save);
 			};
 
 			size = mlt_image_format_size(cached->format, cached->width, cached->height, &bpp );
-- 
1.7.7.6

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to