Fix ClosureThread unittest crash in release build
The crash happens if the thread is created but never started. An improper Join triggered the crash. We should not call Join if the thread is not started. Change-Id: Icace740889089d3b2e15cf6c76c2b0887eb84535
This commit is contained in:
parent
7fd94950d4
commit
c51c6b2731
|
@ -14,7 +14,7 @@ ClosureThread::ClosureThread(
|
|||
: base::SimpleThread(name_prefix), task_(task) {}
|
||||
|
||||
ClosureThread::~ClosureThread() {
|
||||
if (!HasBeenJoined())
|
||||
if (HasBeenStarted() && !HasBeenJoined())
|
||||
Join();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue