From: Jérôme Gardou Date: Sat, 5 Mar 2011 16:23:30 +0000 (+0000) Subject: [OPENGL32] X-Git-Tag: ReactOS-0.3.13~70 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=43f10841e0448ae0e42d382e891a5b1c159551cf;hp=31ebce8a901360c34ae7c8b0ce4b27b921f5dd7a [OPENGL32] - Naive try to fix bug 5057 svn path=/trunk/; revision=50973 --- diff --git a/reactos/dll/win32/opengl32/opengl32.c b/reactos/dll/win32/opengl32/opengl32.c index cf460079bee..1d5330a411b 100644 --- a/reactos/dll/win32/opengl32/opengl32.c +++ b/reactos/dll/win32/opengl32/opengl32.c @@ -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; } }