summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-12-26 23:29:24 (GMT)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-12-26 23:29:24 (GMT)
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 41a6c92..4a7a3c7 100644
--- a/tests/icles/stress-xoverlay.c
+++ b/tests/icles/stress-xoverlay.c
@@ -146,7 +146,7 @@ create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)
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;
}
@@ -161,6 +161,7 @@ create_window (GstBus * bus, GstMessage * message, GstPipeline * 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;
}