mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
bus: Don't allow removing signal watches with gst_bus_remove_watch()
Signal watches are reference counted and gst_bus_remove_watch() would immediately remove it, breaking the reference counting. Only gst_bus_remove_signal_watch() should be used for removing signal watches.
This commit is contained in:
parent
2276336621
commit
8de3344ecc
1 changed files with 8 additions and 2 deletions
10
gst/gstbus.c
10
gst/gstbus.c
|
@ -1052,7 +1052,13 @@ gst_bus_remove_watch (GstBus * bus)
|
||||||
|
|
||||||
if (bus->priv->signal_watch == NULL) {
|
if (bus->priv->signal_watch == NULL) {
|
||||||
GST_ERROR_OBJECT (bus, "no bus watch was present");
|
GST_ERROR_OBJECT (bus, "no bus watch was present");
|
||||||
goto no_watch;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bus->priv->num_signal_watchers > 0) {
|
||||||
|
GST_ERROR_OBJECT (bus,
|
||||||
|
"trying to remove signal watch with gst_bus_remove_watch()");
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch_id = bus->priv->signal_watch;
|
watch_id = bus->priv->signal_watch;
|
||||||
|
@ -1063,7 +1069,7 @@ gst_bus_remove_watch (GstBus * bus)
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
no_watch:
|
error:
|
||||||
GST_OBJECT_UNLOCK (bus);
|
GST_OBJECT_UNLOCK (bus);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue