ASAN leak when exiting node (#2360)

This commit is contained in:
Wesley Shillingford 2019-10-22 22:55:42 +01:00 committed by GitHub
commit a751f85096
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 ();
@ -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 ())