From a9a22649e2ffa1cd3720c8555dc3c6aff2040e3d Mon Sep 17 00:00:00 2001 From: Zoxc Date: Wed, 16 Jun 2010 21:33:30 +0200 Subject: [PATCH] wgl: Only reset GL context on the dummy window. This changes the WGL context destruction code to only reset the GL context for the dummy window, since doing it on is an invalid operation. --- src/cairo-wgl-context.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cairo-wgl-context.c b/src/cairo-wgl-context.c index 7bba1d3fc..ac15b1d21 100644 --- a/src/cairo-wgl-context.c +++ b/src/cairo-wgl-context.c @@ -129,13 +129,11 @@ _wgl_destroy (void *abstract_ctx) { cairo_wgl_context_t *ctx = abstract_ctx; - if (ctx->dummy_dc != 0) { + if (ctx->dummy_dc != 0) { + wglMakeCurrent (ctx->dummy_dc, 0); ReleaseDC (ctx->dummy_wnd, ctx->dummy_dc); DestroyWindow (ctx->dummy_wnd); - CloseHandle (ctx->dummy_wnd); } - - wglMakeCurrent (0, 0); } static cairo_status_t