Bug 718053 - Fix Valgrind warnings (r=cdleary)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 21 Feb 2012 09:49:22 -0800
changeset 88842 323b7bb0129e8ade3145c5a6913f98d379f205fd
parent 88841 3e82c0f0bde72fe16f35d430f6d537ce4e4a75e0
child 88843 163fa5650f57769894b69709e81a71594033c88c
push id975
push userffxbld
push dateTue, 13 Mar 2012 21:39:16 +0000
treeherdermozilla-aurora@99faebf9dc36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscdleary
bugs718053
milestone13.0a1
Bug 718053 - Fix Valgrind warnings (r=cdleary)
js/src/jsapi.cpp
js/src/jsopcode.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -788,17 +788,18 @@ JSRuntime::JSRuntime()
     pendingProxyOperation(NULL),
     trustedPrincipals_(NULL),
     wrapObjectCallback(TransparentObjectWrapper),
     preWrapObjectCallback(NULL),
     preserveWrapperCallback(NULL),
 #ifdef DEBUG
     noGCOrAllocationCheck(0),
 #endif
-    inOOMReport(0)
+    inOOMReport(0),
+    jitHardening(false)
 {
     /* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */
     JS_INIT_CLIST(&contextList);
     JS_INIT_CLIST(&debuggerList);
 
     PodZero(&globalDebugHooks);
     PodZero(&atomState);
 
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -1141,19 +1141,21 @@ js_NewPrinter(JSContext *cx, const char 
         }
     }
     return jp;
 }
 
 void
 js_DestroyPrinter(JSPrinter *jp)
 {
+    JSContext *cx = jp->sprinter.context;
     jp->pool.freeAll();
     Foreground::delete_(jp->localNames);
-    jp->sprinter.context->free_(jp);
+    jp->sprinter.Sprinter::~Sprinter();
+    cx->free_(jp);
 }
 
 JSString *
 js_GetPrinterOutput(JSPrinter *jp)
 {
     JSContext *cx = jp->sprinter.context;
     return JS_NewStringCopyZ(cx, jp->sprinter.string());
 }