Skip to content
  • Heinrich Fink's avatar
    glib: Don't store CF run loop to avoid racy cleanup · e75ddb00
    Heinrich Fink authored and Sebastian Dröge's avatar Sebastian Dröge committed
    After polling for file descriptors, the Cocoa select thread did wake up
    the main run loop instance that has been stored in a static variable.
    This variable might have already been set to NULL by
    g_main_context_release, resulting in a segfault of CFRunLoopWakeUp. This
    race is fixed by this commit by simply not storing the main run loop in
    a variable, but instead calling CFRunLoopGetMain locally where needed.
    Within a single process, the main run loop is always the same, and
    always accessible. It is therefore not necessary anyway to remember the
    run loop instance when acquiring the context.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758285
    e75ddb00