More memory leak fixing.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5072 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
donkopunchstania 2010-02-17 07:15:39 +00:00
parent b88f510984
commit c3697df665
4 changed files with 32 additions and 1 deletions

View File

@ -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();

View File

@ -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

View File

@ -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();
}

View File

@ -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"));