summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-12-26 23:29:24 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-12-26 23:29:24 +0000
commit234b18965de6ef5d4457a30ef0d114688b1eef9c (patch)
treef429ba6d4a97afffff2f5a99045d77cc547ff76c
parent133e1cdb566fdb7b183aadce9bf33e81cb25b4bd (diff)
tests: fix warning and memory leak in stress-overlay test
Not all messages have structures and we need to unref messages when returning GST_BUS_DROP in the sync bus handler.
-rw-r--r--tests/icles/stress-xoverlay.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/icles/stress-xoverlay.c b/tests/icles/stress-xoverlay.c
index 41a6c923b..4a7a3c7a2 100644
--- a/tests/icles/stress-xoverlay.c
+++ b/tests/icles/stress-xoverlay.c
@@ -143,13 +143,13 @@ static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)
{
const GstStructure *s;
GstXOverlay *ov = NULL;
s = gst_message_get_structure (message);
- if (!gst_structure_has_name (s, "prepare-xwindow-id")) {
+ if (s == NULL || !gst_structure_has_name (s, "prepare-xwindow-id")) {
return GST_BUS_PASS;
}
ov = GST_X_OVERLAY (GST_MESSAGE_SRC (message));
g_print ("Creating our own window\n");
@@ -158,12 +158,13 @@ create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)
g_timeout_add (50, (GSourceFunc) resize_window, pipeline);
g_timeout_add (50, (GSourceFunc) move_window, pipeline);
g_timeout_add (100, (GSourceFunc) cycle_window, ov);
g_timeout_add (2000, (GSourceFunc) toggle_events, ov);
+ gst_message_unref (message);
return GST_BUS_DROP;
}
#if 0
static gboolean
terminate_playback (GstElement * pipeline)