From d7a38393b702eb825fbb6069914d71352e629775 Mon Sep 17 00:00:00 2001 From: nakeee Date: Mon, 2 Feb 2009 22:31:31 +0000 Subject: [PATCH] some linux stop issue fix (still not working right) please check on windows git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2076 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PluginManager.cpp | 30 ++++++++++++------- .../Plugin_DSP_HLE/Src/PCHW/AOSoundStream.cpp | 8 ++--- Source/Plugins/Plugin_DSP_HLE/Src/main.cpp | 2 +- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp index 3e12ea756e..80f607ba40 100644 --- a/Source/Core/Core/Src/PluginManager.cpp +++ b/Source/Core/Core/Src/PluginManager.cpp @@ -132,6 +132,23 @@ bool CPluginManager::InitPlugins() void CPluginManager::ShutdownPlugins() { + for (int i = 0; i < MAXPADS; i++) { + if (m_pad[i] && OkayToInitPlugin(i)) { + m_pad[i]->Shutdown(); + } + } + + for (int i = 0; i < MAXWIIMOTES; i++) { + if (m_wiimote[i]) m_wiimote[i]->Shutdown(); + } + + if (m_video) + m_video->Shutdown(); + + if (m_dsp) + m_dsp->Shutdown(); + + for (int i = 0; i < MAXPADS; i++) { if (m_pad[i] && OkayToInitPlugin(i)) { Console::Print("Delete: %i\n", i); @@ -140,24 +157,17 @@ void CPluginManager::ShutdownPlugins() m_pad[i] = NULL; } - for (int i = 0; i < MAXWIIMOTES; i++) { - if (m_wiimote[i]) m_wiimote[i]->Shutdown(); - } - for (int i = 0; i < MAXWIIMOTES; i++) { delete m_wiimote[i]; m_wiimote[i] = NULL; } - if (m_video) - m_video->Shutdown(); + delete m_dsp; + m_dsp = NULL; + delete m_video; m_video = NULL; - if (m_dsp) - m_dsp->Shutdown(); - delete m_dsp; - m_dsp = NULL; } // Supporting functions diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/PCHW/AOSoundStream.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/PCHW/AOSoundStream.cpp index 927d4226f5..33350437f6 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/PCHW/AOSoundStream.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/PCHW/AOSoundStream.cpp @@ -49,10 +49,6 @@ void AOSound::SoundLoop() soundCriticalSection->Leave(); soundSyncEvent->Wait(); } - - ao_close(device); - device = NULL; - ao_shutdown(); } void *soundThread(void *args) { @@ -83,6 +79,10 @@ void AOSound::Stop() delete soundCriticalSection; delete thread; delete soundSyncEvent; + + ao_close(device); + device = NULL; + ao_shutdown(); } #endif diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp index ec3f4ce5d7..35d2b657d3 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp @@ -23,7 +23,7 @@ #include "ConfigDlg.h" #include "Debugger/File.h" // For file logging #include "Debugger/Debugger.h" // For the CDebugger class -CDebugger* m_frame; +CDebugger* m_frame = NULL; #endif #include "ConsoleWindow.h" // Common: For the Windows console