Moving setspecific to before DestroyThreadState

This commit is contained in:
Aidan Foster 2022-03-15 17:53:15 +00:00
parent 1f2bfbb6f0
commit 9f59259dc6
1 changed files with 1 additions and 1 deletions

View File

@ -91,12 +91,12 @@ void __eglCurrentTeardown(EGLBoolean doReset)
__eglDestroyAPIState(apiState);
}
__glvndPthreadFuncs.setspecific(threadStateKey, NULL);
while (!glvnd_list_is_empty(&currentThreadStateList)) {
__EGLThreadAPIState *threadState = glvnd_list_first_entry(
&currentThreadStateList, __EGLThreadAPIState, entry);
DestroyThreadState(threadState);
}
__glvndPthreadFuncs.setspecific(threadStateKey, NULL);
if (doReset) {
__glvndPthreadFuncs.mutex_init(&currentStateListMutex, NULL);