From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/unix_wgl.c | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index ada4dbe5498..159753276bc 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -483,27 +483,6 @@ static HGLRC wrap_wglCreateContext( HDC hdc ) return ret; }
-static BOOL wrap_wglDeleteContext( HGLRC hglrc ) -{ - struct wgl_handle *ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT ); - - if (!ptr) return FALSE; - - if (ptr->u.context->tid && ptr->u.context->tid != GetCurrentThreadId()) - { - SetLastError( ERROR_BUSY ); - release_handle_ptr( ptr ); - return FALSE; - } - if (hglrc == NtCurrentTeb()->glCurrentRC) wglMakeCurrent( 0, 0 ); - ptr->funcs->wgl.p_wglDeleteContext( ptr->u.context->drv_ctx ); - HeapFree( GetProcessHeap(), 0, ptr->u.context->disabled_exts ); - HeapFree( GetProcessHeap(), 0, ptr->u.context->extensions ); - HeapFree( GetProcessHeap(), 0, ptr->u.context ); - free_handle_ptr( ptr ); - return TRUE; -} - static BOOL wrap_wglMakeCurrent( HDC hdc, HGLRC hglrc ) { BOOL ret = TRUE; @@ -547,6 +526,27 @@ static BOOL wrap_wglMakeCurrent( HDC hdc, HGLRC hglrc ) return ret; }
+static BOOL wrap_wglDeleteContext( HGLRC hglrc ) +{ + struct wgl_handle *ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT ); + + if (!ptr) return FALSE; + + if (ptr->u.context->tid && ptr->u.context->tid != GetCurrentThreadId()) + { + SetLastError( ERROR_BUSY ); + release_handle_ptr( ptr ); + return FALSE; + } + if (hglrc == NtCurrentTeb()->glCurrentRC) wrap_wglMakeCurrent( 0, 0 ); + ptr->funcs->wgl.p_wglDeleteContext( ptr->u.context->drv_ctx ); + HeapFree( GetProcessHeap(), 0, ptr->u.context->disabled_exts ); + HeapFree( GetProcessHeap(), 0, ptr->u.context->extensions ); + HeapFree( GetProcessHeap(), 0, ptr->u.context ); + free_handle_ptr( ptr ); + return TRUE; +} + static BOOL wrap_wglShareLists( HGLRC hglrcSrc, HGLRC hglrcDst ) { BOOL ret = FALSE;