Fix #136345: Win32 Error# (6): The handle is invalid
Calling wglMakeCurrent(nullptr, nullptr) without an active context returns an error, so we always pass the device context handle. Pull Request: https://projects.blender.org/blender/blender/pulls/136462
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user