diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.cpp b/Source/Core/DiscIO/Src/NANDContentLoader.cpp index afd26c2ea5..a4c0a7f4e8 100644 --- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp @@ -425,7 +425,6 @@ cUIDsys::cUIDsys() if (m_Elements.empty()) { - SElement Element; *(u64*)&(Element.titleID) = Common::swap64(TITLEID_SYSMENU); *(u32*)&(Element.UID) = Common::swap32(lastUID++); diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 9c2013fc4a..4461fd4fd7 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -51,6 +51,10 @@ IMPLEMENT_APP(DolphinApp) +BEGIN_EVENT_TABLE(DolphinApp, wxApp) + EVT_TIMER(wxID_ANY, DolphinApp::AfterInit) +END_EVENT_TABLE() + #include bool wxMsgAlert(const char*, const char*, bool, int); std::string wxStringTranslator(const char *); @@ -321,6 +325,12 @@ bool DolphinApp::OnInit() SetTopWindow(main_frame); main_frame->SetMinSize(wxSize(400, 300)); + // Postpone final actions until event handler is running. + // Updating the game list makes use of wxProgressDialog which may + // only be run after OnInit() when the event handler is running. + m_afterinit = new wxTimer(this, wxID_ANY); + m_afterinit->Start(1, wxTIMER_ONE_SHOT); + return true; } @@ -329,12 +339,15 @@ void DolphinApp::MacOpenFile(const wxString &fileName) FileToLoad = fileName; LoadFile = true; - if (IsMainLoopRunning()) + if (m_afterinit == NULL) main_frame->BootGame(std::string(FileToLoad.mb_str())); } -int DolphinApp::MainLoop() +void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) { + delete m_afterinit; + m_afterinit = NULL; + if (!BatchMode) main_frame->UpdateGameList(); @@ -362,8 +375,6 @@ int DolphinApp::MainLoop() } } } - - return wxApp::MainLoop(); } void DolphinApp::InitLanguageSupport() diff --git a/Source/Core/DolphinWX/Src/Main.h b/Source/Core/DolphinWX/Src/Main.h index b756e08f14..0fb99fcfd4 100644 --- a/Source/Core/DolphinWX/Src/Main.h +++ b/Source/Core/DolphinWX/Src/Main.h @@ -35,12 +35,15 @@ private: void InitLanguageSupport(); void MacOpenFile(const wxString &fileName); + DECLARE_EVENT_TABLE() + + wxTimer *m_afterinit; bool BatchMode; bool LoadFile; wxString FileToLoad; wxLocale *m_locale; - int MainLoop(); + void AfterInit(wxTimerEvent& WXUNUSED(event)); }; DECLARE_APP(DolphinApp);