summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authordonkopunchstania <donkopunchstania@gmail.com>2010-02-17 07:15:39 +0000
committerdonkopunchstania <donkopunchstania@gmail.com>2010-02-17 07:15:39 +0000
commitc3697df665b2c4357e1efd628c146d36ceb2b390 (patch)
tree87cbfec9b028ee4a8db8964d811b9a3d3865a632 /Source
parentb88f5109841b4db4c754c6cea14ba6b7174954de (diff)
More memory leak fixing.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5072 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/Src/Core.cpp6
-rw-r--r--Source/Core/DiscIO/Src/FileMonitor.cpp22
-rw-r--r--Source/Core/DiscIO/Src/FileMonitor.h1
-rw-r--r--Source/Core/DolphinWX/Src/LogWindow.cpp4
4 files changed, 32 insertions, 1 deletions
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp
index 5f60137a42..4a0d092595 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -56,6 +56,9 @@
#include "PluginManager.h"
#include "ConfigManager.h"
+
+#include "VolumeHandler.h"
+#include "FileMonitor.h"
#include "MemTools.h"
#include "Host.h"
@@ -527,6 +530,9 @@ THREAD_RETURN EmuThread(void *pArg)
cpuThread = NULL;
}
+ VolumeHandler::EjectVolume();
+ FileMon::Close();
+
// Stop audio thread - Actually this does nothing on HLE plugin.
// But stops the DSP Interpreter on LLE plugin.
Plugins.GetDSP()->DSP_StopSoundStream();
diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp
index 854ba8a08d..06f4a7b789 100644
--- a/Source/Core/DiscIO/Src/FileMonitor.cpp
+++ b/Source/Core/DiscIO/Src/FileMonitor.cpp
@@ -145,5 +145,27 @@ void FindFilename(u64 offset)
CheckFile(fname, pFileSystem->GetFileSize(fname));
}
+void Close()
+{
+ if(OpenISO != NULL)
+ {
+ delete OpenISO;
+ OpenISO = NULL;
+ }
+
+ if(pFileSystem != NULL)
+ {
+ delete pFileSystem;
+ pFileSystem = NULL;
+ }
+
+ // GCFiles' pointers are no longer valid after pFileSystem is cleared
+ GCFiles.clear();
+
+ ISOFile = "";
+ CurrentFile = "";
+ FileAccess = true;
+}
+
} // FileMon
diff --git a/Source/Core/DiscIO/Src/FileMonitor.h b/Source/Core/DiscIO/Src/FileMonitor.h
index 9178508610..a54cd544e0 100644
--- a/Source/Core/DiscIO/Src/FileMonitor.h
+++ b/Source/Core/DiscIO/Src/FileMonitor.h
@@ -28,5 +28,6 @@ void ShowSound(std::string File);
void ReadGC(std::string File);
void CheckFile(std::string File, int Size);
void FindFilename(u64 Offset);
+void Close();
}
diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp
index a8fafd273e..51a518622e 100644
--- a/Source/Core/DolphinWX/Src/LogWindow.cpp
+++ b/Source/Core/DolphinWX/Src/LogWindow.cpp
@@ -80,7 +80,9 @@ void CLogWindow::CreateGUIControls()
m_verbosity->SetFont(wxFont(7, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
// Font
- m_FontChoice = new wxChoice(this, IDM_FONT, wxDefaultPosition, wxDefaultSize, * new wxArrayString(), 0, wxDefaultValidator);
+ wxArrayString wxArray;
+ m_FontChoice = new wxChoice(this, IDM_FONT, wxDefaultPosition, wxDefaultSize, wxArray, 0, wxDefaultValidator);
+
m_FontChoice->Append(wxT("Default font"));
m_FontChoice->Append(wxT("Monospaced font"));
m_FontChoice->Append(wxT("Selected font"));