Don't access stack-allocated variable when it is out of scope. Enable Isolate cleanup...
authorsvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 4 Feb 2014 12:23:30 +0000 (12:23 +0000)
committersvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 4 Feb 2014 12:23:30 +0000 (12:23 +0000)
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/146973005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19068 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/cctest.h
test/cctest/test-api.cc

index 6c67dd5..d9f7629 100644 (file)
@@ -131,8 +131,7 @@ class CcTest {
       v8::Isolate* isolate = CcTest::isolate());
 
   static void TearDown() {
-    // TODO(svenpanne) Enable this when our cctests are fixed.
-    // if (isolate_ != NULL) isolate_->Dispose();
+    if (isolate_ != NULL) isolate_->Dispose();
   }
 
  private:
index 2ff92ea..f473f5c 100644 (file)
@@ -737,14 +737,13 @@ TEST(MakingExternalUnalignedAsciiString) {
   CcTest::heap()->CollectGarbage(i::NEW_SPACE);  // in old gen now
 
   // Turn into external string with unaligned resource data.
-  int dispose_count = 0;
   const char* c_cons = "_abcdefghijklmnopqrstuvwxyz";
   bool success = cons->MakeExternal(
-      new TestAsciiResource(i::StrDup(c_cons), &dispose_count, 1));
+      new TestAsciiResource(i::StrDup(c_cons), NULL, 1));
   CHECK(success);
   const char* c_slice = "_bcdefghijklmnopqrstuvwxyz";
   success = slice->MakeExternal(
-      new TestAsciiResource(i::StrDup(c_slice), &dispose_count, 1));
+      new TestAsciiResource(i::StrDup(c_slice), NULL, 1));
   CHECK(success);
 
   // Trigger GCs and force evacuation.