Bug 999274 - Wait for the last runnable before calling ShutdownScriptLoader. r=sicking

This commit is contained in:
Ben Turner 2014-05-20 08:34:25 -04:00
parent b7ca61366d
commit 313ebd014c

View File

@ -781,7 +781,9 @@ ScriptExecutorRunnable::PostRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
NS_IMETHODIMP
ScriptExecutorRunnable::Cancel()
{
ShutdownScriptLoader(mWorkerPrivate->GetJSContext(), mWorkerPrivate, false);
if (mLastIndex == mScriptLoader.mLoadInfos.Length() - 1) {
ShutdownScriptLoader(mWorkerPrivate->GetJSContext(), mWorkerPrivate, false);
}
return MainThreadWorkerSyncRunnable::Cancel();
}