gloverlay: free the image memory every time the location changes

fixes a memory leak
This commit is contained in:
Matthew Waters 2014-09-26 12:28:10 +10:00
parent 9c6c82887f
commit eaa424cec7

View file

@ -475,12 +475,11 @@ gst_gl_overlay_filter_texture (GstGLFilter * filter, guint in_tex,
GstGLOverlay *overlay = GST_GL_OVERLAY (filter); GstGLOverlay *overlay = GST_GL_OVERLAY (filter);
if (overlay->location_has_changed) { if (overlay->location_has_changed) {
if (overlay->location == NULL) { if (overlay->image_memory) {
if (overlay->image_memory) { gst_memory_unref ((GstMemory *) overlay->image_memory);
gst_memory_unref ((GstMemory *) overlay->image_memory); overlay->image_memory = NULL;
overlay->image_memory = NULL; }
} if (overlay->location != NULL) {
} else {
if ((overlay->type_file = gst_gl_overlay_load_png (filter)) == 0) { if ((overlay->type_file = gst_gl_overlay_load_png (filter)) == 0) {
if ((overlay->type_file = gst_gl_overlay_load_jpeg (filter)) == 0) { if ((overlay->type_file = gst_gl_overlay_load_jpeg (filter)) == 0) {
return FALSE; return FALSE;