From af8c83dd7c6ca684722d80998716b94dd2d948f4 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Mon, 13 Aug 2012 16:30:34 +0000 Subject: [PATCH] -fixed wiiflow reboot crashes after new theme selection -may fixed some boot problems of games, channels, homebrew, etc --- source/menu/menu.cpp | 15 +++++---------- source/menu/menu_game.cpp | 1 + source/menu/menu_main.cpp | 16 +++++++++------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index ed9ab5d7..9f957a43 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -508,16 +508,11 @@ void CMenu::cleanup(bool hb) SoundHandler::DestroyInstance(); soundDeinit(); - if(!m_reload) - { - if(!hb) - DeviceHandler::DestroyInstance(); - m_vid.CheckWaitThread(true); - m_vid.cleanup(); - m_cf.shutdown(); - } - else - m_cf.clear(); + if(!hb) + DeviceHandler::DestroyInstance(); + m_vid.CheckWaitThread(true); + m_vid.cleanup(); + m_cf.shutdown(); wiiLightOff(); _deinitNetwork(); diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 8e02e076..664433e4 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -562,6 +562,7 @@ void CMenu::_game(bool launch) m_cf.clear(); _showWaitMessage(); + exitHandler(0); //Making wiiflow ready to boot something if(hdr->type != TYPE_HOMEBREW && hdr->type != TYPE_PLUGIN) { diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 6867f956..1fd070a7 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -220,7 +220,7 @@ void CMenu::exitHandler(int ExitTo) { gprintf("Exit WiiFlow called\n"); Nand::Instance()->Disable_Emu(); - if(!m_disable_exit) + if(!m_disable_exit || ExitTo == 0) { m_exit = true; if(ExitTo == 1) // HBC @@ -244,7 +244,7 @@ void CMenu::exitHandler(int ExitTo) } 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 extern bool exiting; @@ -821,8 +821,13 @@ int CMenu::main(void) } } if(m_reload) + { + m_cf.clear(); _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"); m_cfg.save(); m_cat.unload(); @@ -832,10 +837,7 @@ int CMenu::main(void) coverStatus = LWP_THREAD_NULL; if(coverstatus_stack.get()) coverstatus_stack.release(); - if(!m_reload) - return 0; - cleanup(); - return 1; + return 0; } void CMenu::_initMainMenu(CMenu::SThemeData &theme)