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.
This commit is contained in:
Tim-Philipp Müller 2009-12-26 23:29:24 +00:00
parent 133e1cdb56
commit 234b18965d

View file

@ -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;
}