Skip to content
  • Kyle Brenneman's avatar
    Fix a memory leak in libGLdispatch · 70e6a300
    Kyle Brenneman authored
    In __glDispatchMakeCurrent, it allocates a
    __GLdispatchThreadStatePrivate struct, which would normally get freed in
    __glDispatchLoseCurrent.
    
    However, if the library gets unloaded while another thread still has a
    current context, then __glDispatchLoseCurrent never gets called, and so
    that memory leaks.
    
    Add the __GLdispatchThreadStatePrivate to a linked list so that it can
    free any remaining structs in __glDispatchFini.
    
    Fixes glvnd/libglvnd#230.
    70e6a300