GNOME Bugzilla – Bug 639755
discoverer: Clean up callbacks in dispose()
Last modified: 2011-01-17 23:53:18 UTC
This fixes a problem that was exposed by the gst-python bindings - it is possible that a running GstDiscoverer object will be freed before gst_discoverer_stop() is called on it. We do not clean up the async timeout callback in this case, causing a crash if the instance does time out. Attaching a patch to fix this.
Created attachment 178524 [details] [review] discoverer: Clean up callbacks in dispose() Make sure that we unregister the timeout and pad callbacks when disposing the discoverer object to avoid these being triggered after the discoverer object has been freed. This will not happen if gst_discoverer_stop() is called before the object is finally unref'ed, but we need to handle tha case where the _stop() function is not called first as well.
Comment on attachment 178524 [details] [review] discoverer: Clean up callbacks in dispose() Better fix based on review from tpm coming up.
Created attachment 178546 [details] [review] discoverer: Make sure we call _stop() before being freed This ensures that everything is properly cleaned up before the GstDiscoverer object is freed. Specifically, it makes sure that we've removed the async timeout callback before freeing the object to avoid a potential crash later on.
commit e730ce71dc72df6d380d53c1a65aacb0c0c134b6 Author: Arun Raghavan <arun.raghavan@collabora.co.uk> Date: Tue Jan 18 00:08:32 2011 +0530 discoverer: Make sure we call _stop() before being freed This ensures that everything is properly cleaned up before the GstDiscoverer object is freed. Specifically, it makes sure that we've removed the async timeout callback before freeing the object to avoid a potential crash later on. https://bugzilla.gnome.org/show_bug.cgi?id=639755