Commit 8c178113 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

opengl32: Avoid calling back the wglMakeCurrent win32 thunk.

parent b003fa79
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment