From 234b18965de6ef5d4457a30ef0d114688b1eef9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 26 Dec 2009 23:29:24 +0000 Subject: [PATCH] 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. --- tests/icles/stress-xoverlay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.7.4