From c51c6b2731544259e00bdf46ba43a26f1aed881c Mon Sep 17 00:00:00 2001 From: Kongqun Yang Date: Fri, 18 Apr 2014 18:48:41 -0700 Subject: [PATCH] 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 --- media/base/closure_thread.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/base/closure_thread.cc b/media/base/closure_thread.cc index e737a46fcd..a83809509a 100644 --- a/media/base/closure_thread.cc +++ b/media/base/closure_thread.cc @@ -14,7 +14,7 @@ ClosureThread::ClosureThread( : base::SimpleThread(name_prefix), task_(task) {} ClosureThread::~ClosureThread() { - if (!HasBeenJoined()) + if (HasBeenStarted() && !HasBeenJoined()) Join(); }