From 6376645b6925bef5ee015452dcb5d2b1a72247cc Mon Sep 17 00:00:00 2001 From: donkopunchstania Date: Sat, 6 Mar 2010 03:25:06 +0000 Subject: [PATCH] Shut down the video software plugin without closing dolphin in Windows. Fixed a memory leak. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5162 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoSoftware/Src/Win32.cpp | 9 +++++---- Source/Plugins/Plugin_VideoSoftware/Src/main.cpp | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Win32.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Win32.cpp index 133465fe6a..ee7bad6599 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Win32.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Win32.cpp @@ -201,14 +201,15 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam ) case WM_CLOSE: if (m_hParent == NULL) { - // Simple hack to easily exit without stopping. Hope to fix the stopping errors soon. - ExitProcess(0); + // Take it out of fullscreen and stop the game + if( g_Config.bFullscreen ) + ToggleFullscreen(m_hParent); + PostMessage(m_hMain, WM_USER, WM_USER_STOP, 0); } break; case WM_DESTROY: - //Shutdown(); - //PostQuitMessage( 0 ); // Call WM_QUIT + Shutdown(); break; // Called when a screensaver wants to show up while this window is active diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp index 6640f1faa5..c53bb5c6a5 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp @@ -98,6 +98,7 @@ void EmuStateChange(PLUGIN_EMUSTATE newState) void Shutdown(void) { + Renderer::Shutdown(); OpenGL_Shutdown(); }