-fixed wiiflow reboot crashes after new theme selection

-may fixed some boot problems of games, channels, homebrew, etc
This commit is contained in:
fix94.1 2012-08-13 16:30:34 +00:00
parent e685842c59
commit af8c83dd7c
3 changed files with 15 additions and 17 deletions

View File

@ -508,16 +508,11 @@ void CMenu::cleanup(bool hb)
SoundHandler::DestroyInstance(); SoundHandler::DestroyInstance();
soundDeinit(); soundDeinit();
if(!m_reload)
{
if(!hb) if(!hb)
DeviceHandler::DestroyInstance(); DeviceHandler::DestroyInstance();
m_vid.CheckWaitThread(true); m_vid.CheckWaitThread(true);
m_vid.cleanup(); m_vid.cleanup();
m_cf.shutdown(); m_cf.shutdown();
}
else
m_cf.clear();
wiiLightOff(); wiiLightOff();
_deinitNetwork(); _deinitNetwork();

View File

@ -562,6 +562,7 @@ void CMenu::_game(bool launch)
m_cf.clear(); m_cf.clear();
_showWaitMessage(); _showWaitMessage();
exitHandler(0); //Making wiiflow ready to boot something
if(hdr->type != TYPE_HOMEBREW && hdr->type != TYPE_PLUGIN) if(hdr->type != TYPE_HOMEBREW && hdr->type != TYPE_PLUGIN)
{ {

View File

@ -220,7 +220,7 @@ void CMenu::exitHandler(int ExitTo)
{ {
gprintf("Exit WiiFlow called\n"); gprintf("Exit WiiFlow called\n");
Nand::Instance()->Disable_Emu(); Nand::Instance()->Disable_Emu();
if(!m_disable_exit) if(!m_disable_exit || ExitTo == 0)
{ {
m_exit = true; m_exit = true;
if(ExitTo == 1) // HBC if(ExitTo == 1) // HBC
@ -244,7 +244,7 @@ void CMenu::exitHandler(int ExitTo)
} }
m_reload = (BTN_B_HELD || m_disable_exit); m_reload = (BTN_B_HELD || m_disable_exit);
if(m_exit && !m_reload) //D'oh! if(m_exit)
{ {
// Mark exiting to prevent soundhandler from restarting // Mark exiting to prevent soundhandler from restarting
extern bool exiting; extern bool exiting;
@ -821,8 +821,13 @@ int CMenu::main(void)
} }
} }
if(m_reload) if(m_reload)
{
m_cf.clear();
_showWaitMessage(); _showWaitMessage();
exitHandler(0); //Making wiiflow ready to boot something
_launchHomebrew(fmt("%s/boot.dol", m_appDir.c_str()), m_homebrewArgs);
return 0;
}
gprintf("Saving configuration files\n"); gprintf("Saving configuration files\n");
m_cfg.save(); m_cfg.save();
m_cat.unload(); m_cat.unload();
@ -832,10 +837,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();
if(!m_reload)
return 0; return 0;
cleanup();
return 1;
} }
void CMenu::_initMainMenu(CMenu::SThemeData &theme) void CMenu::_initMainMenu(CMenu::SThemeData &theme)