Bug 1142816 - js/src/jsapi-tests/testGCHeapPostBarriers.cpp has leaks

This commit is contained in:
Jinank Jain 2015-05-13 22:58:11 +02:00
parent cf6d01d7f1
commit f68ff5facb

View File

@ -8,6 +8,8 @@
#include "js/RootingAPI.h"
#include "jsapi-tests/tests.h"
using mozilla::UniquePtr;
BEGIN_TEST(testGCHeapPostBarriers)
{
#ifdef JS_GC_ZEAL
@ -44,8 +46,8 @@ TestHeapPostBarriers(T initialObj)
CHECK(js::gc::IsInsideNursery(initialObj));
/* Construct Heap<> wrapper. */
JS::Heap<T>* heapData = new JS::Heap<T>();
CHECK(heapData);
UniquePtr<JS::Heap<T>> heapData(new JS::Heap<T>);
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;
}