glmosaic: fix shader leak
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 19 May 2016 13:55:31 +0000 (16:55 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:19 +0000 (19:32 +0000)
gst_gl_mosaic_init_shader() is called twice with test_glmosaic so the
first shader was leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=766661

ext/gl/gstglmosaic.c

index 377f718..bcf3833 100644 (file)
@@ -187,6 +187,7 @@ gst_gl_mosaic_init_shader (GstGLMixer * mixer, GstCaps * outcaps)
 {
   GstGLMosaic *mosaic = GST_GL_MOSAIC (mixer);
 
+  g_clear_object (&mosaic->shader);
   //blocking call, wait the opengl thread has compiled the shader
   return gst_gl_context_gen_shader (GST_GL_BASE_MIXER (mixer)->context,
       mosaic_v_src, mosaic_f_src, &mosaic->shader);