From 173c16ad413c38c9736938321165f549dba2482e Mon Sep 17 00:00:00 2001 From: Sonicadvance1 Date: Fri, 13 Nov 2009 09:04:17 +0000 Subject: [PATCH] Should fix a crash that was deleting a invalid pointer that happens when we unload plugins before freeing pads, if this causes problems anywhere, please tell me git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4553 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PluginManager.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp index 0c5ed2d6f7..13b265c710 100644 --- a/Source/Core/Core/Src/PluginManager.cpp +++ b/Source/Core/Core/Src/PluginManager.cpp @@ -76,12 +76,11 @@ CPluginManager::~CPluginManager() for (int i = 0; i < MAXPADS; i++) { - if (m_pad[i] && (OkayToInitPlugin(i) == -1)) + if (m_pad[i] && (OkayToInitPlugin(i) == -1) && !m_params->m_strPadPlugin[i].empty()) { INFO_LOG(CONSOLE, "Delete: %i\n", i); - delete m_pad[i]; + FreePad(i); } - m_pad[i] = NULL; } for (int i = 0; i < MAXWIIMOTES; i++) @@ -165,9 +164,9 @@ void CPluginManager::ShutdownPlugins() if (m_pad[i]) { m_pad[i]->Shutdown(); - //delete m_pad[i]; + delete m_pad[i]; } - //m_pad[i] = NULL; + m_pad[i] = NULL; } for (int i = 0; i < MAXWIIMOTES; i++)