smart-video-mixer: unref pads_info hash table in dispose

Before gst_bin_dispose() runs and destroys elements.
This commit is contained in:
Tim-Philipp Müller 2014-10-30 15:54:04 +00:00
parent 9b82267aef
commit 5c79b5539b

View file

@ -171,13 +171,25 @@ _release_pad (GstElement * element, GstPad * pad)
/****************************************************
* GObject vmethods *
****************************************************/
static void
ges_smart_mixer_dispose (GObject * object)
{
GESSmartMixer *self = GES_SMART_MIXER (object);
if (self->pads_infos != NULL) {
g_hash_table_unref (self->pads_infos);
self->pads_infos = NULL;
}
G_OBJECT_CLASS (ges_smart_mixer_parent_class)->dispose (object);
}
static void
ges_smart_mixer_finalize (GObject * object)
{
GESSmartMixer *self = GES_SMART_MIXER (object);
g_mutex_clear (&self->lock);
g_hash_table_unref (self->pads_infos);
G_OBJECT_CLASS (ges_smart_mixer_parent_class)->finalize (object);
}
@ -203,6 +215,7 @@ ges_smart_mixer_class_init (GESSmartMixerClass * klass)
element_class->request_new_pad = GST_DEBUG_FUNCPTR (_request_new_pad);
element_class->release_pad = GST_DEBUG_FUNCPTR (_release_pad);
object_class->dispose = ges_smart_mixer_dispose;
object_class->finalize = ges_smart_mixer_finalize;
}