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

This commit is contained in:
Thomas Faber
2023-01-27 22:31:37 -05:00
parent 8b19b6ec5a
commit afb953ae4d
@@ -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;
}