win32: only deinit ogl imgui when ogl is initialized

This commit is contained in:
OV2 2023-05-08 19:06:14 +02:00
parent 5481bb0436
commit c7e6e9c211
1 changed files with 2 additions and 2 deletions

View File

@ -151,12 +151,12 @@ bool COpenGL::Initialize(HWND hWnd)
void COpenGL::DeInitialize() void COpenGL::DeInitialize()
{ {
initDone = false; if (initDone && S9xImGuiRunning())
if (S9xImGuiRunning())
{ {
ImGui_ImplOpenGL3_Shutdown(); ImGui_ImplOpenGL3_Shutdown();
S9xImGuiDeinit(); S9xImGuiDeinit();
} }
initDone = false;
SetShaders(NULL); SetShaders(NULL);
DestroyDrawSurface(); DestroyDrawSurface();
wglMakeCurrent(NULL,NULL); wglMakeCurrent(NULL,NULL);