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 committed by Tim-Philipp Müller
parent 17fa8eac04
commit f4afec4657

View file

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