Bug 522839 - Deal with OOM when creating a context for a new worker thread. r=bent

This commit is contained in:
Blake Kaplan 2009-11-11 11:28:22 +01:00
parent b5c54b7e05
commit 42d9e3ec70

View File

@ -372,7 +372,10 @@ public:
// Make sure we have a JSContext to run everything on.
JSContext* cx = (JSContext*)PR_GetThreadPrivate(gJSContextIndex);
NS_ASSERTION(cx, "nsDOMThreadService didn't give us a context!");
if (!cx) {
NS_ERROR("nsDOMThreadService didn't give us a context! Are we out of memory?");
return NS_ERROR_FAILURE;
}
NS_ASSERTION(!JS_GetGlobalObject(cx), "Shouldn't have a global!");