diff --git a/intern/ghost/intern/GHOST_ContextWGL.cc b/intern/ghost/intern/GHOST_ContextWGL.cc index 4e05f134faf..54ff1b80d5a 100644 --- a/intern/ghost/intern/GHOST_ContextWGL.cc +++ b/intern/ghost/intern/GHOST_ContextWGL.cc @@ -120,7 +120,9 @@ GHOST_TSuccess GHOST_ContextWGL::activateDrawingContext() GHOST_TSuccess GHOST_ContextWGL::releaseDrawingContext() { - if (WIN32_CHK(::wglMakeCurrent(nullptr, nullptr))) { + /* Calling wglMakeCurrent(nullptr, nullptr) without an active context returns an error, + * so we always pass the device context handle. */ + if (WIN32_CHK(::wglMakeCurrent(m_hDC, nullptr))) { return GHOST_kSuccess; } else {