From: ddennedy Date: Tue, 27 Jan 2009 06:41:54 +0000 (+0000) Subject: producer_pixbuf.c: bugfix (kdenlive-575) memory leak X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fa2efa33bf8641996c2171b5b3fc33f51e0f126f;p=mlt producer_pixbuf.c: bugfix (kdenlive-575) memory leak git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1327 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/modules/gtk2/producer_pixbuf.c b/src/modules/gtk2/producer_pixbuf.c index c56e91de..591631ce 100644 --- a/src/modules/gtk2/producer_pixbuf.c +++ b/src/modules/gtk2/producer_pixbuf.c @@ -201,19 +201,21 @@ static void refresh_image( mlt_frame frame, int width, int height ) // Obtain properties of producer mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer ); + // Obtain the cache flag and structure + int use_cache = mlt_properties_get_int( producer_props, "cache" ); + mlt_properties cache = mlt_properties_get_data( producer_props, "_cache", NULL ); + int update_cache = 0; + // Check if user wants us to reload the image if ( mlt_properties_get_int( producer_props, "force_reload" ) ) { pixbuf = NULL; + if ( !use_cache && this->image ) + mlt_pool_release( this->image ); this->image = NULL; mlt_properties_set_int( producer_props, "force_reload", 0 ); } - // Obtain the cache flag and structure - int use_cache = mlt_properties_get_int( producer_props, "cache" ); - mlt_properties cache = mlt_properties_get_data( producer_props, "_cache", NULL ); - int update_cache = 0; - // Get the time to live for each frame double ttl = mlt_properties_get_int( producer_props, "ttl" ); @@ -488,9 +490,6 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i // Ensure that we have a way to obtain the position in the get_image mlt_properties_set_position( properties, "pixbuf_position", mlt_producer_position( producer ) ); - // Refresh the image - refresh_image( *frame, 0, 0 ); - // Set producer-specific frame properties mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( producer_properties, "progressive" ) ); mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );