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:
Kongqun Yang 2014-04-18 18:48:41 -07:00
parent 7fd94950d4
commit c51c6b2731
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ ClosureThread::ClosureThread(
: base::SimpleThread(name_prefix), task_(task) {}
ClosureThread::~ClosureThread() {
if (!HasBeenJoined())
if (HasBeenStarted() && !HasBeenJoined())
Join();
}