Bug 622691: fix unlock order in AutoLockDefaultCompartment, r=gal

This commit is contained in:
David Mandelin 2011-01-05 17:26:31 -08:00
parent 98169843b9
commit 6f64880260

View File

@ -2650,10 +2650,10 @@ class AutoLockDefaultCompartment {
#endif
}
~AutoLockDefaultCompartment() {
JS_UNLOCK(cx, &cx->runtime->atomState.lock);
#ifdef JS_THREADSAFE
cx->runtime->defaultCompartmentIsLocked = false;
#endif
JS_UNLOCK(cx, &cx->runtime->atomState.lock);
}
};
@ -2668,10 +2668,10 @@ class AutoUnlockDefaultCompartment {
#endif
}
~AutoUnlockDefaultCompartment() {
JS_LOCK(cx, &cx->runtime->atomState.lock);
#ifdef JS_THREADSAFE
cx->runtime->defaultCompartmentIsLocked = true;
#endif
JS_LOCK(cx, &cx->runtime->atomState.lock);
}
};