diff --git a/LunaHost/GUI/LunaHost.cpp b/LunaHost/GUI/LunaHost.cpp index 2e08aee..5f329ba 100644 --- a/LunaHost/GUI/LunaHost.cpp +++ b/LunaHost/GUI/LunaHost.cpp @@ -36,12 +36,12 @@ bool sendclipboarddata(const std::wstring&text,HWND hwnd){ return false; } void LunaHost::on_close(){ + hasstoped=true; savesettings(); delete configs; for(auto pid:attachedprocess){ Host::DetachProcess(pid); } - hasstoped=true; if(attachedprocess.size()) std::this_thread::sleep_for(std::chrono::milliseconds(100)); } diff --git a/LunaHost/GUI/LunaHost.h b/LunaHost/GUI/LunaHost.h index ec39ab2..e906052 100644 --- a/LunaHost/GUI/LunaHost.h +++ b/LunaHost/GUI/LunaHost.h @@ -96,7 +96,7 @@ class LunaHost:public mainwindow{ Settingwindow *settingwindow=0; Pluginmanager* plugins; Hooksearchwindow * hooksearchwindow=0; - bool hasstoped=false; + std::atomic hasstoped=false; bool on_text_recv(TextThread& thread, std::wstring& sentence); void on_text_recv_checkissaved(TextThread& thread); void on_thread_create(TextThread& thread);