From a3eccef3fab2150bf611413ad7483703d18e946a Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Tue, 27 Mar 2012 07:37:06 +0000 Subject: [PATCH] Valgrind cleanliness, part 1: Delete current isolate on exit. Currently we leak 140kB from 80 allocation sites when we evaluate a simple "print(1+2)" in d8 and exit. This might not be a real problem in Chrome because most of the time the whole process containing v8 vanishes, but it can hide real leaks in a sea of false positives. Therefore, this CL and a few subsequent ones clean this up a bit. This simple CL alone fixes 45 leaks, leaving only 35 with a net loss of 2192 bytes (on ia32). Review URL: https://chromiumcodereview.appspot.com/9791016 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11146 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/v8.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/v8.cc b/src/v8.cc index 506f3f6..fdc8a90 100644 --- a/src/v8.cc +++ b/src/v8.cc @@ -103,7 +103,9 @@ void V8::TearDown() { ASSERT(isolate->IsDefaultIsolate()); if (!has_been_set_up_ || has_been_disposed_) return; + isolate->TearDown(); + delete isolate; is_running_ = false; has_been_disposed_ = true; -- 2.7.4