producer_pixbuf.c: bugfix (kdenlive-575) memory leak; revert unnecessary part of...
[melted] / src / modules / gtk2 / producer_pixbuf.c
index c56e91d..9e0d4cf 100644 (file)
@@ -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" );