mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
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:
parent
133e1cdb56
commit
234b18965d
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue