From 2f1fa9c7ea2efaed7a6065c7f560ff6b883f8bcf Mon Sep 17 00:00:00 2001 From: Ben Turner Date: Sun, 7 Dec 2008 16:15:45 -0800 Subject: [PATCH] Bug 465141 - 'Workers: Implement expression flavor of timeouts, use nsAutoJSValHolder'. Followup OOM check to bustage fix. r+sr=jst, a=blocking1.9.1 --- dom/src/threads/nsDOMWorkerTimeout.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/src/threads/nsDOMWorkerTimeout.cpp b/dom/src/threads/nsDOMWorkerTimeout.cpp index bde3ac3d64c..05797396175 100644 --- a/dom/src/threads/nsDOMWorkerTimeout.cpp +++ b/dom/src/threads/nsDOMWorkerTimeout.cpp @@ -126,7 +126,10 @@ nsDOMWorkerTimeout::FunctionCallback::Run(nsDOMWorkerTimeout* aTimeout, JSObject* global = JS_GetGlobalObject(aCx); NS_ENSURE_TRUE(global, NS_ERROR_FAILURE); - nsTArray argv(mCallbackArgsLength); + nsTArray argv; + PRBool success = argv.SetCapacity(mCallbackArgsLength); + NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY); + for (PRUint32 index = 0; index < mCallbackArgsLength; index++) { argv.AppendElement(mCallbackArgs[index]); }