[OPENGL32]

- Naive try to fix bug 5057

svn path=/trunk/; revision=50973
This commit is contained in:
Jérôme Gardou 2011-03-05 16:23:30 +00:00
parent 31ebce8a90
commit 43f10841e0

View file

@ -72,7 +72,7 @@ static void
OPENGL32_ThreadDetach( void )
{
GLTHREADDATA* lpData = NULL;
PROC *dispatchTable = NULL;
TEB* teb = NtCurrentTeb();
rosglMakeCurrent( NULL, NULL );
@ -85,12 +85,15 @@ OPENGL32_ThreadDetach( void )
lpData = NULL;
}
dispatchTable = NtCurrentTeb()->glTable;
if (dispatchTable != NULL)
if (teb->glTable != NULL)
{
if (!HeapFree( GetProcessHeap(), 0, dispatchTable ))
if (!HeapFree( GetProcessHeap(), 0, teb->glTable ))
{
DBGPRINT( "Warning: HeapFree() on dispatch table failed (%d)",
GetLastError() );
}
/* NULL-ify it. Even if something went wrong, it's not a good idea to keep it non NULL */
teb->glTable = NULL;
}
}