mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
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:
parent
51b23bbff7
commit
7a0155e735
1 changed files with 14 additions and 0 deletions
|
@ -49,6 +49,7 @@ static void gst_gl_mixer_pad_get_property (GObject * object, guint prop_id,
|
|||
GValue * value, GParamSpec * pspec);
|
||||
static void gst_gl_mixer_pad_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_gl_mixer_pad_finalize (GObject * object);
|
||||
|
||||
static void gst_gl_mixer_set_context (GstElement * element,
|
||||
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->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
|
||||
|
|
Loading…
Reference in a new issue