diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index f9d2155e..dd133dac 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -488,7 +488,7 @@ void CMenu::init(void) bool cleaned_up = false; -void CMenu::cleanup() +void CMenu::cleanup(bool hb) { if(cleaned_up) return; @@ -509,7 +509,8 @@ void CMenu::cleanup() if(!m_reload) { - DeviceHandler::DestroyInstance(); + if(!hb) + DeviceHandler::DestroyInstance(); m_vid.CheckWaitThread(true); m_vid.cleanup(); } diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index 601f9683..9e1ef5c0 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -47,7 +47,7 @@ public: void terror(const char *key, const wchar_t *msg) { error(_fmt(key, msg)); } void exitHandler(int ExitTo); int main(void); - void cleanup(); + void cleanup(bool hb = false); u8 m_current_view; private: struct SZone diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 416bda16..39415e61 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -899,9 +899,10 @@ void CMenu::_launchHomebrew(const char *filepath, vector arguments) m_cfg.save(true); Playlog_Delete(); - cleanup(); // wifi and sd gecko doesnt work anymore after cleanup + cleanup(true); // wifi and sd gecko doesnt work anymore after cleanup LoadHomebrew(filepath); + DeviceHandler::DestroyInstance(); //homebrew loaded, we can unmount devices now AddBootArgument(filepath); for(u32 i = 0; i < arguments.size(); ++i) AddBootArgument(arguments[i].c_str());