Skip to content
  • Sebastian Dröge's avatar
    Add g_source_set_dispose_function() for setting a dispose function for GSource · 0adf5cae
    Sebastian Dröge authored
    This allows GSource implementors to safely clear any other references to
    the GSource while the GSource is still valid, unlike when doing the same
    from the finalize function.
    
    After the dispose function has run, it is valid for the reference count
    of the GSource to be > 0 again to allow the case where another thread in
    the mean-time got access to the GSource reference before the dispose
    function was called.
    
    This allows fixing a thread-safety issue in the GCancellable, GstBus and
    various other GSource implementations.
    0adf5cae