diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2019-02-15 14:20:27 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-02 10:31:25 +0300 |
commit | 90e031132418c3583ce238d511182d72fadfd6c6 (patch) | |
tree | 7a6286dbfce8641dc1b472d55cd062dafc328a5d | |
parent | fd06d56d489b7291bcb3e4a8f41dd410eee92ccd (diff) |
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.
-rw-r--r-- | gst/gstbus.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/gstbus.c b/gst/gstbus.c index 81f2fb97d9..a2bf62e61c 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -1054,7 +1054,13 @@ gst_bus_remove_watch (GstBus * bus) if (bus->priv->signal_watch == NULL) { 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; @@ -1065,7 +1071,7 @@ gst_bus_remove_watch (GstBus * bus) return TRUE; -no_watch: +error: GST_OBJECT_UNLOCK (bus); return FALSE; |