mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
smart-adder: fix crash in unit test
Unref pads_info hash table in dispose instead of finalize, i.e. before gst_bin_dispose runs and destroys pads_info->bin (to which the pads_info does not hold a ref).
This commit is contained in:
parent
05588c416a
commit
9b82267aef
1 changed files with 14 additions and 1 deletions
|
@ -147,13 +147,25 @@ _release_pad (GstElement * element, GstPad * pad)
|
|||
/****************************************************
|
||||
* GObject vmethods *
|
||||
****************************************************/
|
||||
static void
|
||||
ges_smart_adder_dispose (GObject * object)
|
||||
{
|
||||
GESSmartAdder *self = GES_SMART_ADDER (object);
|
||||
|
||||
if (self->pads_infos) {
|
||||
g_hash_table_unref (self->pads_infos);
|
||||
self->pads_infos = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (ges_smart_adder_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
ges_smart_adder_finalize (GObject * object)
|
||||
{
|
||||
GESSmartAdder *self = GES_SMART_ADDER (object);
|
||||
|
||||
g_mutex_clear (&self->lock);
|
||||
g_hash_table_unref (self->pads_infos);
|
||||
|
||||
G_OBJECT_CLASS (ges_smart_adder_parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -179,6 +191,7 @@ ges_smart_adder_class_init (GESSmartAdderClass * 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_adder_dispose;
|
||||
object_class->finalize = ges_smart_adder_finalize;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue