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.
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;
return TRUE;
-no_watch:
+error:
GST_OBJECT_UNLOCK (bus);
return FALSE;