Skip to content
  • David Zeuthen's avatar
    GDBusConnection: Avoid callbacks on finalized connection · f0b04acf
    David Zeuthen authored
    
    
    Turns out that GDBusWorker will issue callbacks (in its own thread)
    even after g_dbus_worker_stop() has been called. This would rarely
    happen (and unreffing a connection is even rarer) so only saw this bug
    occasionally when running the gdbus-connection test case in a loop.
    
    Fix up this issue by maintaining a set of GDBusConnection objects that
    are currently "alive" and do nothing in the callbacks if the passed
    user_data pointer is not in this set.
    
    Also attempted to fix up a race condition with
    _g_object_wait_for_single_ref_do() and its use of GObject toggle
    references - for now, just resort to busy waiting, thereby
    sidestepping the toggle reference mess altogether.
    
    Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
    f0b04acf