A few fixes to resets and shutdowns. Fixes a few memory leaks.

Thanks a bunch, ksi3zyc :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2698 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2010-03-11 21:16:35 +00:00
parent 72ce9993d2
commit ee6b27aeb8
4 changed files with 15 additions and 4 deletions

View File

@ -322,13 +322,14 @@ static __forceinline ElfObject *loadElfCRC( const wxString filename )
static __forceinline void _reloadElfInfo(wxString str)
{
ElfObject *elfptr;
ScopedPtr<ElfObject> elfptr;
// Now's a good time to reload the ELF info...
ScopedLock locker( Mutex_NewDiskCB );
elfptr = loadElfCRC(str);
elfptr->applyPatches();
elfptr.Delete();
}
static __forceinline void reloadElfInfo(u32 discType, wxString str)

View File

@ -447,7 +447,7 @@ void loadElfFile(const wxString& _filename)
void loadElfFile(const wxString& filename)
#endif
{
ElfObject *elfptr;
ScopedPtr<ElfObject> elfptr;
bool iscdvd;
#ifdef USE_HOSTFS
@ -546,6 +546,7 @@ void loadElfFile(const wxString& filename)
elfptr->getCRC();
Console.WriteLn( L"loadElfFile: %s; CRC = %8.8X", filename.c_str(), ElfCRC );
elfptr->applyPatches();
elfptr.Delete();
return;
}

View File

@ -22,6 +22,9 @@
#include "System/PageFaultSource.h"
#include "Utilities/EventSource.inl"
extern void closeNewVif(int idx);
extern void resetNewVif(int idx);
template class EventSource< IEventListener_PageFault >;
SrcType_PageFault Source_PageFault;
@ -309,6 +312,8 @@ void SysCoreAllocations::CleanupMess() throw()
recCpu.Shutdown();
vuMicroMemShutdown();
closeNewVif(0);
closeNewVif(1);
psxMemShutdown();
memShutdown();
vtlb_Core_Shutdown();
@ -367,6 +372,9 @@ void SysClearExecutionCache()
Cpu->Reset();
psxCpu->Reset();
resetNewVif(0);
resetNewVif(1);
CpuVU0->Reset();
CpuVU1->Reset();
}

View File

@ -252,6 +252,7 @@ void MainEmuFrame::Menu_BootCdvd_Click( wxCommandEvent &event )
}
}
sApp.SysReset();
sApp.SysExecute( g_Conf->CdvdSource );
}