glmixer: unref the GstGLUpload in the pad if freed while running

Dynamic pipelines that get and release the sink pads will finalize
the pad without going through gst_gl_mixer_stop() which is where the
upload object is usually freed.  Don't leak objects in such case.
This commit is contained in:
Matthew Waters 2014-08-19 17:01:36 +10:00
parent 51b23bbff7
commit 7a0155e735

View file

@ -49,6 +49,7 @@ static void gst_gl_mixer_pad_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static void gst_gl_mixer_pad_set_property (GObject * object, guint prop_id, static void gst_gl_mixer_pad_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_gl_mixer_pad_finalize (GObject * object);
static void gst_gl_mixer_set_context (GstElement * element, static void gst_gl_mixer_set_context (GstElement * element,
GstContext * context); GstContext * context);
@ -85,6 +86,19 @@ gst_gl_mixer_pad_class_init (GstGLMixerPadClass * klass)
gobject_class->set_property = gst_gl_mixer_pad_set_property; gobject_class->set_property = gst_gl_mixer_pad_set_property;
gobject_class->get_property = gst_gl_mixer_pad_get_property; gobject_class->get_property = gst_gl_mixer_pad_get_property;
gobject_class->finalize = gst_gl_mixer_pad_finalize;
}
static void
gst_gl_mixer_pad_finalize (GObject * object)
{
GstGLMixerPad *pad = GST_GL_MIXER_PAD (object);
if (pad->upload) {
gst_object_unref (pad->upload);
pad->upload = NULL;
}
} }
static void static void