From f5f5ba1f2c6226d4a2588a19a4bbfca9a7da5048 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Mon, 14 May 2012 11:29:41 -0700 Subject: [PATCH] Bug 725499. r=bent --- dom/workers/WorkerPrivate.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index d8f7c9f9822..d8adfc64ff4 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -1759,11 +1759,14 @@ WorkerRunnable::Run() JSObject* targetCompartmentObject; nsIThreadJSContextStack* contextStack = nsnull; + nsRefPtr kungFuDeathGrip; + if (mTarget == WorkerThread) { mWorkerPrivate->AssertIsOnWorkerThread(); cx = mWorkerPrivate->GetJSContext(); targetCompartmentObject = JS_GetGlobalObject(cx); } else { + kungFuDeathGrip = mWorkerPrivate; mWorkerPrivate->AssertIsOnParentThread(); cx = mWorkerPrivate->ParentJSContext(); targetCompartmentObject = mWorkerPrivate->GetJSObject();