SuperVU: fixed null pointer dereference in constructing an exception object.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5406 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1@gmail.com 2012-09-05 22:35:49 +00:00
parent b1541f4ab7
commit 5ccc4bbfdf
1 changed files with 3 additions and 2 deletions

View File

@ -350,7 +350,8 @@ static void SuperVUAlloc(int vuindex)
{
if (s_recVUMem[vuindex]) return;
s_recVUMem[vuindex] = new RecompiledCodeReserve( pxsFmt("SuperVU%u Recompiler Cache", vuindex), 0 );
wxString mem_name = pxsFmt("SuperVU%u Recompiler Cache", vuindex);
s_recVUMem[vuindex] = new RecompiledCodeReserve( mem_name, 0 );
s_recVUMem[vuindex]->Reserve( sVU_EXESIZE, vuindex ? HostMemoryMap::sVU1rec : HostMemoryMap::sVU0rec, _256mb );
s_recVUMem[vuindex]->SetProfilerName(pxsFmt("sVU%urec",vuindex));
@ -358,7 +359,7 @@ static void SuperVUAlloc(int vuindex)
if (!s_recVUMem[vuindex]->IsOk())
{
safe_delete(s_recVUMem[vuindex]);
throw Exception::VirtualMemoryMapConflict( s_recVUMem[vuindex]->GetName() )
throw Exception::VirtualMemoryMapConflict(mem_name)
.SetDiagMsg(pxsFmt( L"SuperVU failed to allocate virtual memory below 256MB." ))
.SetUserMsg(pxE( L"Out of Memory (sorta): The SuperVU recompiler was unable to reserve the specific memory ranges required, and will not be available for use. This is not a critical error, since the sVU rec is obsolete, and you should use microVU instead anyway. :)"
));