Skip to content

Commit

Permalink
ASAN leak when exiting node (#2360)
Browse files Browse the repository at this point in the history
  • Loading branch information
wezrule authored Oct 22, 2019
1 parent f0d010d commit a751f85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nano/lib/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ void nano::worker::push_task (std::function<void()> func_a)
{
{
nano::lock_guard<std::mutex> guard (mutex);
queue.emplace_back (func_a);
if (!stopped)
{
queue.emplace_back (func_a);
}
}

cv.notify_one ();
Expand All @@ -292,6 +295,7 @@ void nano::worker::stop ()
{
nano::unique_lock<std::mutex> lk (mutex);
stopped = true;
queue.clear ();
}
cv.notify_one ();
if (thread.joinable ())
Expand Down

0 comments on commit a751f85

Please sign in to comment.