After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 639755 - discoverer: Clean up callbacks in dispose()
discoverer: Clean up callbacks in dispose()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-17 15:48 UTC by Arun Raghavan
Modified: 2011-01-17 23:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
discoverer: Clean up callbacks in dispose() (2.51 KB, patch)
2011-01-17 15:48 UTC, Arun Raghavan
none Details | Review
discoverer: Make sure we call _stop() before being freed (2.03 KB, patch)
2011-01-17 18:44 UTC, Arun Raghavan
committed Details | Review

Description Arun Raghavan 2011-01-17 15:48:53 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.
Comment 1 Arun Raghavan 2011-01-17 15:48:56 UTC
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 2 Arun Raghavan 2011-01-17 18:42:50 UTC
Comment on attachment 178524 [details] [review]
discoverer: Clean up callbacks in dispose()

Better fix based on review from tpm coming up.
Comment 3 Arun Raghavan 2011-01-17 18:44:18 UTC
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.
Comment 4 Tim-Philipp Müller 2011-01-17 23:53:06 UTC
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