void glXDestroyContext(Display *pDisplay, GLXContext ctx) { auto *pState = reinterpret_cast<OGL::State *>(ctx); if (contexts.find(pState) == currentContext) { currentContext = contexts.end(); } contexts.erase(pState); OGL::Destroy(*pState); pState->~State(); _aligned_free(pState); }
WINGDIAPI BOOL WINAPI DrvDeleteContext(HGLRC hglrc) { int rc = (int)hglrc; SWRContext &context = gContexts[rc]; OGL::State *pState = context.pState; pState->~State(); _aligned_free(pState); OGL::GetDDProcTable().pfnDestroyContext(OGL::GetDDHandle()); gContexts.erase(rc); OGL::DestroyGlobals(); return 1; }