diff memory_profiler.cpp @ 58:0b66a265df13

Fixed some bugs that raised assertions in debug builds of SpiderMonkey.
author Atul Varma <varmaa@toolness.com>
date Wed, 24 Jun 2009 21:15:45 -0700
parents 1fd63ee398dc
children ab600a5e6516
line wrap: on
line diff
--- a/memory_profiler.cpp	Wed Jun 24 19:38:05 2009 -0700
+++ b/memory_profiler.cpp	Wed Jun 24 21:15:45 2009 -0700
@@ -284,7 +284,10 @@
   JS_SetVersion(serverCx, JSVERSION_LATEST);
   JS_SetErrorReporter(serverCx, reportError);
 
+  JS_BeginRequest(serverCx);
+
   JSObject *serverGlobal = JS_NewObject(serverCx, &global_class, NULL, NULL);
+
   if (serverGlobal == NULL) {
     JS_ReportError(cx, "Couldn't create server JS global.");
     return JS_FALSE;
@@ -324,6 +327,7 @@
 
   /* Cleanup. */
   JS_DHashTableFinish(&tracingState.visited);
+  JS_EndRequest(serverCx);
   JS_DestroyContext(serverCx);
   JS_DestroyRuntime(serverRuntime);