Skip to content

Commit

Permalink
* other crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Walter committed Jun 19, 2023
1 parent 9d73c4e commit 2590cb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Application/src/tracker/misc/RepeatedDeferral.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ struct RepeatedDeferral {
}

void quit() {
if(not _terminate){
{
std::unique_lock guard(_mutex);
_terminate = true;
notify();
}

if(_updater && _updater->joinable())
_updater->join();
_updater = nullptr;
Expand All @@ -132,7 +133,10 @@ struct RepeatedDeferral {
}

if(_next.empty())
_new_item.wait(guard, [this]() {return not _next.empty(); });
_new_item.wait(guard, [this]() {return not _next.empty() or _terminate; });

if(_terminate)
throw std::runtime_error("Terminated");

auto e = timer.elapsed();
{
Expand Down

0 comments on commit 2590cb9

Please sign in to comment.