[BUTTERFLIES] Do not release the DC passed to OpenGL. CORE-18498

This commit is contained in:
Thomas Faber 2023-01-16 19:45:03 -05:00
parent 8b19b6ec5a
commit afb953ae4d
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -12,6 +12,7 @@
HINSTANCE hInstance; // Holds The Instance Of The Application
GLuint texture[3]; //stores texture objects and display list
HDC hdcOpenGL;
LPCTSTR registryPath = _T("Software\\Microsoft\\ScreenSavers\\Butterflies");
BOOL dRotate;
@ -136,7 +137,7 @@ HGLRC InitOGLWindow(HWND hWnd)
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, hRC);
ReleaseDC(hWnd, hDC);
hdcOpenGL = hDC;
return hRC;
}
@ -287,6 +288,7 @@ LRESULT WINAPI ScreenSaverProc(HWND hWnd, UINT message,
case WM_DESTROY:
wglMakeCurrent(NULL, NULL);
wglDeleteContext(hRC);
ReleaseDC(hWnd, hdcOpenGL);
break;
}