winex11: Don't delete the DC if it's not for a valid pbuffer.

This commit is contained in:
Alexandre Julliard 2012-10-17 21:40:52 +02:00
parent 6cda76fd99
commit 64aed7c5be
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}
/**