-return to system menu should be a bit more safe now :P

This commit is contained in:
fix94.1 2012-05-22 20:08:56 +00:00
parent bd40c72b13
commit bcf1fd48f1
4 changed files with 14 additions and 40 deletions

View File

@ -249,30 +249,11 @@ void CVideo::cleanup(void)
m_aaBuffer[i].release(); m_aaBuffer[i].release();
} }
for(u8 i = 0; i < m_defaultWaitMessages.size(); i++) for(u8 i = 0; i < m_defaultWaitMessages.size(); i++)
{
if(m_defaultWaitMessages[i].data.get())
m_defaultWaitMessages[i].data.release(); m_defaultWaitMessages[i].data.release();
}
if(m_frameBuf[0] != NULL)
{
free(MEM_K1_TO_K0(m_frameBuf[0])); free(MEM_K1_TO_K0(m_frameBuf[0]));
m_frameBuf[0] = NULL;
}
if(m_frameBuf[1] != NULL)
{
free(MEM_K1_TO_K0(m_frameBuf[1])); free(MEM_K1_TO_K0(m_frameBuf[1]));
m_frameBuf[0] = NULL;
}
if(m_stencil != NULL)
{
MEM1_free(m_stencil); MEM1_free(m_stencil);
m_stencil = NULL;
}
if(m_fifo != NULL)
{
MEM1_free(m_fifo); MEM1_free(m_fifo);
m_fifo = NULL;
}
} }
void CVideo::prepareAAPass(int aaStep) void CVideo::prepareAAPass(int aaStep)

View File

@ -136,14 +136,10 @@ int main(int argc, char **argv)
ret = menu.main(); ret = menu.main();
} }
} }
if(ret == 1)
Open_Inputs(); //reinit wiimote Open_Inputs(); //reinit wiimote
} while (ret == 1); } while (ret == 1);
WifiGecko_Close();
Nand::Instance()->Disable_Emu();
Nand::DestroyInstance();
Sys_Exit(); Sys_Exit();
return 0; return 0;
}; };

View File

@ -462,8 +462,13 @@ void CMenu::init(void)
} }
} }
bool cleaned_up = false;
void CMenu::cleanup(bool ios_reload) void CMenu::cleanup(bool ios_reload)
{ {
if(cleaned_up)
return;
m_cf.stopCoverLoader(); m_cf.stopCoverLoader();
m_cf.clear(); m_cf.clear();
ClearGameSoundThreadStack(); ClearGameSoundThreadStack();
@ -500,6 +505,7 @@ void CMenu::cleanup(bool ios_reload)
_deinitNetwork(); _deinitNetwork();
ClearLogBuffer(); ClearLogBuffer();
cleaned_up = true;
gprintf(" \nMemory cleaned up\n"); gprintf(" \nMemory cleaned up\n");
} }

View File

@ -790,14 +790,6 @@ int CMenu::main(void)
m_cf.mouse(m_vid, chan, -1, -1); m_cf.mouse(m_vid, chan, -1, -1);
} }
} }
_showWaitMessage();
gprintf("Invalidate GX\n");
GX_InvVtxCache();
GX_InvalidateTexAll();
gprintf("Clear coverflow\n");
m_cf.clear();
gprintf("Saving configuration files\n"); gprintf("Saving configuration files\n");
m_cfg.save(); m_cfg.save();
m_cat.save(); m_cat.save();
@ -807,8 +799,7 @@ int CMenu::main(void)
coverStatus = LWP_THREAD_NULL; coverStatus = LWP_THREAD_NULL;
if(coverstatus_stack.get()) if(coverstatus_stack.get())
coverstatus_stack.release(); coverstatus_stack.release();
cleanup();
gprintf("Done with main\n");
return m_reload ? 1 : 0; return m_reload ? 1 : 0;
} }