GNOME Bugzilla – Bug 526044
Crash if there is more than one watcher for a GstBus
Last modified: 2008-10-13 09:22:19 UTC
a GstBus can only have one watcher on a GMainloop because the dispatch function pops the GstMessage from the bus, so the second watcher may get a NULL (or a different message). Imho, having non-signal watches should simply be deprecated.. But anyways, I'm attaching a patch that keeps track of watches and only allows one to be set.
Created attachment 108568 [details] [review] Patch to GstBus to only allow one watcher
2008-10-13 Sebastian Dröge <sebastian.droege@collabora.co.uk> Base on Patch by: Olivier Crete <tester at tester dot ca> * gst/gstbus.c: (gst_bus_source_finalize), (gst_bus_add_watch_full), (gst_bus_add_signal_watch_full): Only allow one bus watch to be set at a time. This is necessary because the dispatcher pops the message from the bus and the second watcher will then get NULL or the next message (and the first won't get this next message then, etc). If more than one "watcher" is required signal watches should be used. Fixes bug #526044.