wgl: Check for multiple threads before GET_CURRENT_CONTEXT.

Fixes wglthreads -- the 2nd thread MakeCurrent call was trying to flush
the first thread context while still in use.
This commit is contained in:
José Fonseca
2009-07-06 17:40:08 +01:00
parent 5470a67335
commit 6f4167c8a2
@@ -60,8 +60,14 @@ stw_context(GLcontext *glctx)
static INLINE struct stw_context *
stw_current_context(void)
{
GET_CURRENT_CONTEXT( glctx );
return stw_context(glctx);
/* We must check if multiple threads are being used or GET_CURRENT_CONTEXT
* might return the current context of the thread first seen. */
_glapi_check_multithread();
{
GET_CURRENT_CONTEXT( glctx );
return stw_context(glctx);
}
}
BOOL