VirtualBox

Ignore:
Timestamp:
Oct 25, 2012 4:59:17 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: proper renderspu tsd cleanup on context destruction

Location:
trunk/src/VBox/HostServices/SharedOpenGL/render
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r41929 r43748  
    173173renderspuDestroyContext( GLint ctx )
    174174{
    175     ContextInfo *context;
     175    ContextInfo *context, *curCtx;
    176176
    177177    CRASSERT(ctx);
     
    185185    }
    186186    crHashtableDelete(render_spu.contextTable, ctx, crFree);
     187
     188    curCtx = GET_CONTEXT_VAL();
     189    if (curCtx == context)
     190        SET_CONTEXT_VAL(NULL);
    187191}
    188192
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r43182 r43748  
    280280#ifdef CHROMIUM_THREADSAFE
    281281extern CRtsd _RenderTSD;
    282 #define GET_CONTEXT(T)  ContextInfo *T = (ContextInfo *) crGetTSD(&_RenderTSD)
     282#define GET_CONTEXT_VAL() ((ContextInfo *) crGetTSD(&_RenderTSD))
     283#define SET_CONTEXT_VAL(_v) do { \
     284        crSetTSD(&_RenderTSD, (_v)); \
     285    } while (0)
    283286#else
    284 #define GET_CONTEXT(T)  ContextInfo *T = render_spu.currentContext
    285 #endif
     287#define GET_CONTEXT_VAL() (render_spu.currentContext)
     288#define SET_CONTEXT_VAL(_v) do { \
     289        render_spu.currentContext = (_v); \
     290    } while (0)
     291
     292#endif
     293
     294#define GET_CONTEXT(T)  ContextInfo *T = GET_CONTEXT_VAL()
    286295
    287296extern void renderspuSetVBoxConfiguration( RenderSPU *spu );
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette