diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 305cae3b7d..9eef4b3d0c 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -82,6 +82,8 @@ std::string wxStringTranslator(const char*); CFrame* main_frame = nullptr; +static std::mutex s_init_mutex; + bool DolphinApp::Initialize(int& c, wxChar** v) { #if defined HAVE_X11 && HAVE_X11 @@ -94,6 +96,7 @@ bool DolphinApp::Initialize(int& c, wxChar** v) bool DolphinApp::OnInit() { + std::lock_guard lk(s_init_mutex); if (!wxApp::OnInit()) return false; @@ -548,6 +551,7 @@ bool Host_RendererIsFullscreen() void Host_ConnectWiimote(int wm_idx, bool connect) { + std::lock_guard lk(s_init_mutex); if (connect) { wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FORCE_CONNECT_WIIMOTE1 + wm_idx);