mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
tests/check/gst/gstelement.c: Don't leak the factory.
Original commit message from CVS: * tests/check/gst/gstelement.c: (GST_START_TEST): Don't leak the factory.
This commit is contained in:
parent
a2fc403bb6
commit
4c9ba80be2
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-04-12 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* tests/check/gst/gstelement.c: (GST_START_TEST):
|
||||||
|
Don't leak the factory.
|
||||||
|
|
||||||
2006-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
|
2006-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -163,7 +163,7 @@ GST_END_TEST;
|
||||||
GST_START_TEST (test_class)
|
GST_START_TEST (test_class)
|
||||||
{
|
{
|
||||||
GstElementClass *klass;
|
GstElementClass *klass;
|
||||||
GstElementFactory *factory;
|
GstElementFactory *factory, *tmp;
|
||||||
GType type;
|
GType type;
|
||||||
|
|
||||||
GST_DEBUG ("finding factory for queue");
|
GST_DEBUG ("finding factory for queue");
|
||||||
|
@ -176,10 +176,13 @@ GST_START_TEST (test_class)
|
||||||
fail_if (type != 0);
|
fail_if (type != 0);
|
||||||
|
|
||||||
GST_DEBUG ("now loading the plugin");
|
GST_DEBUG ("now loading the plugin");
|
||||||
factory =
|
tmp =
|
||||||
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
|
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
|
||||||
(factory)));
|
(factory)));
|
||||||
fail_if (factory == NULL);
|
fail_if (tmp == NULL);
|
||||||
|
|
||||||
|
gst_object_unref (factory);
|
||||||
|
factory = tmp;
|
||||||
|
|
||||||
/* feature is now loaded */
|
/* feature is now loaded */
|
||||||
type = gst_element_factory_get_element_type (factory);
|
type = gst_element_factory_get_element_type (factory);
|
||||||
|
@ -192,6 +195,7 @@ GST_START_TEST (test_class)
|
||||||
/* and elementfactory is filled in */
|
/* and elementfactory is filled in */
|
||||||
fail_if (klass->elementfactory == NULL);
|
fail_if (klass->elementfactory == NULL);
|
||||||
fail_if (klass->elementfactory != factory);
|
fail_if (klass->elementfactory != factory);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
Loading…
Reference in a new issue