mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-03 13:16:04 +00:00
tests/glbin: setting a full reference means we need to unref
Fixes the element leaks in the full variants of the glbin test.
This commit is contained in:
parent
273da3ed2f
commit
d5b18ae58f
|
@ -34,8 +34,6 @@ typedef GstElement *(*CreateElement) (GstElement * src, gpointer unused);
|
||||||
|
|
||||||
#define CREATE_ELEMENT(e,c,d) \
|
#define CREATE_ELEMENT(e,c,d) \
|
||||||
g_signal_connect (e, "create-element", G_CALLBACK (c), d)
|
g_signal_connect (e, "create-element", G_CALLBACK (c), d)
|
||||||
#define SET_ELEMENT(e,p,c,d) \
|
|
||||||
g_object_set (e, p, c (e, d), NULL)
|
|
||||||
|
|
||||||
static GstElement *
|
static GstElement *
|
||||||
_create_element_floating_cb (GstElement * src, const gchar * name)
|
_create_element_floating_cb (GstElement * src, const gchar * name)
|
||||||
|
@ -58,14 +56,16 @@ struct src_data
|
||||||
static void
|
static void
|
||||||
_set_element_floating (GstElement * e, struct src_data *d /* static */ )
|
_set_element_floating (GstElement * e, struct src_data *d /* static */ )
|
||||||
{
|
{
|
||||||
SET_ELEMENT (e, d->prop, _create_element_floating_cb,
|
g_object_set (e, d->prop, _create_element_floating_cb (e, d->element_name),
|
||||||
(gchar *) d->element_name);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_set_element_full (GstElement * e, struct src_data *d /* static */ )
|
_set_element_full (GstElement * e, struct src_data *d /* static */ )
|
||||||
{
|
{
|
||||||
SET_ELEMENT (e, d->prop, _create_element_full_cb, (gchar *) d->element_name);
|
GstElement *element = _create_element_full_cb (e, d->element_name);
|
||||||
|
g_object_set (e, d->prop, element, NULL);
|
||||||
|
gst_object_unref (element);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue