Alexandre Julliard : winex11: Don't delete the DC if it' s not for a valid pbuffer.
Module: wine Branch: master Commit: 64aed7c5be455db9315a39e33fdc84dd3a284255 URL: http://source.winehq.org/git/wine.git/?a=commit;h=64aed7c5be455db9315a39e33f... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 17 21:40:52 2012 +0200 winex11: Don't delete the DC if it's not for a valid pbuffer. --- dlls/winex11.drv/opengl.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 5151e20..cf99876 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2318,14 +2318,17 @@ static int X11DRV_wglReleasePbufferDCARB( struct wgl_pbuffer *object, HDC hdc ) TRACE("(%p, %p)\n", object, hdc); EnterCriticalSection( &context_section ); + if (!XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&gl )) { XDeleteContext( gdi_display, (XID)hdc, gl_pbuffer_context ); free_gl_drawable( gl ); } + else hdc = 0; + LeaveCriticalSection( &context_section ); - return DeleteDC(hdc); + return hdc && DeleteDC(hdc); } /**
participants (1)
-
Alexandre Julliard