From 591e2a1e096618979250f062648b731367e60710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 6 Jul 2010 16:18:02 +0200 Subject: Don't call GetDC() nedlessly. It seems that the CS_OWNDC class style flag only returns the same DC when GetDC() is called in the same thread that created the window. This in turn generates a bad DC resource leak if you have a rendering thread with one or more GL context switches, so just call GetDC() when you actually need to. Reviewed-by: Kim --- src/opengl/qgl_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp index 5ab944a..52988b6 100644 --- a/src/opengl/qgl_win.cpp +++ b/src/opengl/qgl_win.cpp @@ -1283,7 +1283,7 @@ void QGLContext::makeCurrent() if (d->rc == wglGetCurrentContext() || !d->valid) // already current return; - if (d->win) { + if (d->win && !d->dc) { d->dc = GetDC(d->win); if (!d->dc) { qwglError("QGLContext::makeCurrent()", "GetDC()"); -- cgit v0.12