Don't access stack-allocated variable when it is out of scope. Enable Isolate...

Don't access stack-allocated variable when it is out of scope. Enable Isolate cleanup in cctests again.

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
parent 443e645a
......@@ -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:
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment