1
0
mirror of synced 2024-11-27 17:10:51 +01:00

fix: Crash on exit

This commit is contained in:
WerWolv 2023-10-30 16:39:57 +01:00
parent a980097d64
commit 94ad6e6072

View File

@ -986,7 +986,8 @@ namespace hex {
}
for (auto &service : getServices()) {
service.thread.detach();
if (service.thread.joinable())
service.thread.join();
}
}
@ -997,7 +998,7 @@ namespace hex {
impl::getServices().push_back(impl::Service {
unlocalizedName,
std::jthread([callback](const std::stop_token &stopToken){
std::jthread([callback = auto(callback)](const std::stop_token &stopToken){
while (!stopToken.stop_requested()) {
callback();
std::this_thread::sleep_for(std::chrono::milliseconds(50));