mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
fix: Crash on exit
This commit is contained in:
@@ -986,7 +986,8 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto &service : getServices()) {
|
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 {
|
impl::getServices().push_back(impl::Service {
|
||||||
unlocalizedName,
|
unlocalizedName,
|
||||||
std::jthread([callback](const std::stop_token &stopToken){
|
std::jthread([callback = auto(callback)](const std::stop_token &stopToken){
|
||||||
while (!stopToken.stop_requested()) {
|
while (!stopToken.stop_requested()) {
|
||||||
callback();
|
callback();
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||||
|
|||||||
Reference in New Issue
Block a user