Bug 725499. r=bent
authorKyle Huey <khuey@kylehuey.com>
Mon, 14 May 2012 11:29:41 -0700
changeset 93863 498d2784a240243e991e1b5f12c33a6657b6520f
parent 93862 3bd6844f2898d2c83bf64ab68fa2626b73adcd5f
child 93881 3ab55d40ecd4059e5a3a638eac85844806923729
child 94015 61e99099ba4e3bb42bbe100ad9a451b4515f8806
child 106183 50177d59c0e173e03d93ef7a3b67a704f1a1cb34
push id22685
push userkhuey@mozilla.com
push dateMon, 14 May 2012 18:38:33 +0000
treeherdermozilla-central@498d2784a240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs725499
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 725499. r=bent
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -1754,21 +1754,24 @@ WorkerRunnable::PostDispatch(JSContext* 
 
 NS_IMETHODIMP
 WorkerRunnable::Run()
 {
   JSContext* cx;
   JSObject* targetCompartmentObject;
   nsIThreadJSContextStack* contextStack = nsnull;
 
+  nsRefPtr<WorkerPrivate> kungFuDeathGrip;
+
   if (mTarget == WorkerThread) {
     mWorkerPrivate->AssertIsOnWorkerThread();
     cx = mWorkerPrivate->GetJSContext();
     targetCompartmentObject = JS_GetGlobalObject(cx);
   } else {
+    kungFuDeathGrip = mWorkerPrivate;
     mWorkerPrivate->AssertIsOnParentThread();
     cx = mWorkerPrivate->ParentJSContext();
     targetCompartmentObject = mWorkerPrivate->GetJSObject();
 
     if (!mWorkerPrivate->GetParent()) {
       AssertIsOnMainThread();
 
       contextStack = nsContentUtils::ThreadJSContextStack();