Removing a bus watch when tearing down a pipeline

Sebastian Dröge sebastian at centricular.com
Thu Aug 13 23:51:43 PDT 2015


On Do, 2015-08-13 at 17:43 +0200, Guillermo Rodriguez Garcia wrote:
> Hello all,
> 
> I am attaching a bus watch to a pipeline using gst_bus_add_watch. I
> have some questions:
> 
> 1. When I tear down the pipeline (by setting its state to NULL, and
> then calling gst_object_unref(pipeline), do I still need to remove 
> the bus watch to prevent resource leaks? Or isn't this necessary?

It should be destroyed together with the bus, so not necessary.

> 2. Is it possible to remove a watch by calling g_source_remove or
> gst_remove_watch from the bus watch callback function itself? (I know
> that this can also be done by returning FALSE from the callback)

Yes, those can be called at any time from any thread.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150814/c238e266/attachment.sig>


More information about the gstreamer-devel mailing list