fix(thread): check before detach

This commit is contained in:
Alexis
2018-08-29 21:07:58 +02:00
parent 9a1b8bb831
commit d0933ab50f
3 changed files with 13 additions and 5 deletions

View File

@ -74,7 +74,9 @@ struct SleeperThread {
{
do_run_ = false;
condvar_.notify_all();
thread_.detach();
if (thread_.joinable()) {
thread_.detach();
}
}
private: