From 7816efe92553d27c6253131c34c05356f1828e6b Mon Sep 17 00:00:00 2001 From: Jinank Jain Date: Wed, 27 May 2015 10:30:36 +0200 Subject: [PATCH] Bug 1142816 - js/src/jsapi-tests/testGCHeapPostBarriers.cpp has leaks. r=erahm --- js/src/jsapi-tests/testGCHeapPostBarriers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/src/jsapi-tests/testGCHeapPostBarriers.cpp b/js/src/jsapi-tests/testGCHeapPostBarriers.cpp index 88c33b6db26..c0fcabbf7c9 100644 --- a/js/src/jsapi-tests/testGCHeapPostBarriers.cpp +++ b/js/src/jsapi-tests/testGCHeapPostBarriers.cpp @@ -8,6 +8,8 @@ #include "js/RootingAPI.h" #include "jsapi-tests/tests.h" +using mozilla::ScopedDeletePtr; + BEGIN_TEST(testGCHeapPostBarriers) { #ifdef JS_GC_ZEAL @@ -44,8 +46,8 @@ TestHeapPostBarriers(T initialObj) CHECK(js::gc::IsInsideNursery(initialObj)); /* Construct Heap<> wrapper. */ - JS::Heap* heapData = new JS::Heap(); - CHECK(heapData); + ScopedDeletePtr> heapData(new JS::Heap); + CHECK(heapData.get()); CHECK(Passthrough(heapData->get() == nullptr)); *heapData = initialObj; @@ -64,7 +66,6 @@ TestHeapPostBarriers(T initialObj) CHECK(value.isInt32()); CHECK(value.toInt32() == 42); - delete heapData; return true; }