gst-plugins-base: tests: plug some more object and caps leaks
Mark Nauwelaerts
mnauw at kemper.freedesktop.org
Wed Apr 4 11:00:42 PDT 2012
Module: gst-plugins-base
Branch: master
Commit: 8da252a21c719b50520755d88384533f3ffb2cba
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=8da252a21c719b50520755d88384533f3ffb2cba
Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date: Wed Apr 4 19:41:34 2012 +0200
tests: plug some more object and caps leaks
---
tests/check/libs/profile.c | 15 +++++++++++++--
tests/check/pipelines/capsfilter-renegotiation.c | 2 ++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/tests/check/libs/profile.c b/tests/check/libs/profile.c
index 5d3a5b2..158648f 100644
--- a/tests/check/libs/profile.c
+++ b/tests/check/libs/profile.c
@@ -31,16 +31,27 @@
#include <gst/pbutils/encoding-profile.h>
#include <gst/pbutils/encoding-target.h>
+static inline gboolean
+gst_caps_is_equal_unref (GstCaps * caps1, GstCaps * caps2)
+{
+ gboolean ret;
+
+ ret = gst_caps_is_equal (caps1, caps2);
+ gst_caps_unref (caps1);
+
+ return ret;
+}
+
#define CHECK_PROFILE(profile, name, description, format, preset, presence, restriction) \
{ \
fail_if(profile == NULL); \
fail_unless_equals_string (gst_encoding_profile_get_name (profile), name); \
fail_unless_equals_string (gst_encoding_profile_get_description (profile), description); \
- fail_unless (gst_caps_is_equal (gst_encoding_profile_get_format (profile), format)); \
+ fail_unless (gst_caps_is_equal_unref (gst_encoding_profile_get_format (profile), format)); \
fail_unless_equals_string (gst_encoding_profile_get_preset (profile), preset); \
fail_unless_equals_int (gst_encoding_profile_get_presence (profile), presence); \
if (restriction) \
- fail_unless (gst_caps_is_equal (gst_encoding_profile_get_restriction (profile), restriction)); \
+ fail_unless (gst_caps_is_equal_unref (gst_encoding_profile_get_restriction (profile), restriction)); \
}
GST_START_TEST (test_profile_creation)
diff --git a/tests/check/pipelines/capsfilter-renegotiation.c b/tests/check/pipelines/capsfilter-renegotiation.c
index 781dcbd..15bc608 100644
--- a/tests/check/pipelines/capsfilter-renegotiation.c
+++ b/tests/check/pipelines/capsfilter-renegotiation.c
@@ -135,6 +135,8 @@ run_capsfilter_renegotiation (const gchar * launch_line)
current_caps = NULL;
gst_message_unref (msg);
g_object_unref (bus);
+ gst_object_unref (sink);
+ gst_object_unref (capsfilter);
g_object_unref (G_OBJECT (pipeline));
}
More information about the gstreamer-commits
mailing list