{
TRACE("()");
- gl::Current *current = new gl::Current;
+ gl::Current *current = (gl::Current*)sw::Thread::allocateLocalStorage(currentTLS, sizeof(gl::Current));
if(current)
{
- sw::Thread::setLocalStorage(currentTLS, current);
-
current->context = nullptr;
current->display = nullptr;
current->drawSurface = nullptr;
wglMakeCurrent(NULL, NULL);
- delete (gl::Current*)sw::Thread::getLocalStorage(currentTLS);
- sw::Thread::setLocalStorage(currentTLS, nullptr);
+ sw::Thread::freeLocalStorage(currentTLS);
}
CONSTRUCTOR static bool glAttachProcess()