Revision: 6375
Author: [email protected]
Date: Tue Jan 18 16:37:08 2011
Log: [Isolates] Fix memory leaks in Isolate and Logger.

This fixes following bugs:
http://code.google.com/p/v8/issues/detail?id=1035
http://code.google.com/p/v8/issues/detail?id=1036

Review URL: http://codereview.chromium.org/6347005
http://code.google.com/p/v8/source/detail?r=6375

Modified:
 /branches/experimental/isolates/src/isolate.cc
 /branches/experimental/isolates/src/log.cc
 /branches/experimental/isolates/src/log.h

=======================================
--- /branches/experimental/isolates/src/isolate.cc      Mon Dec 13 19:40:56 2010
+++ /branches/experimental/isolates/src/isolate.cc      Tue Jan 18 16:37:08 2011
@@ -499,6 +499,11 @@
   delete cpu_features_;
   cpu_features_ = NULL;

+  delete handle_scope_implementer_;
+  handle_scope_implementer_ = NULL;
+  delete break_access_;
+  break_access_ = NULL;
+
   delete compilation_cache_;
   compilation_cache_ = NULL;
   delete bootstrapper_;
@@ -585,11 +590,6 @@
   regexp_stack_ = new RegExpStack();
   regexp_stack_->isolate_ = this;

-#ifdef ENABLE_DEBUGGER_SUPPORT
-  debugger_ = new Debugger();
-  debugger_->isolate_ = this;
-#endif
-
 #ifdef ENABLE_LOGGING_AND_PROFILING
   producer_heap_profile_ = new ProducerHeapProfile();
   producer_heap_profile_->isolate_ = this;
=======================================
--- /branches/experimental/isolates/src/log.cc  Mon Dec 13 19:40:56 2010
+++ /branches/experimental/isolates/src/log.cc  Tue Jan 18 16:37:08 2011
@@ -347,6 +347,10 @@
     prev_to_(NULL),
     prev_code_(NULL) {
 }
+
+Logger::~Logger() {
+  delete log_;
+}

 #define DECLARE_LONG_EVENT(ignore1, long_name, ignore2) long_name,
static const char* const kLongLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS] = {
=======================================
--- /branches/experimental/isolates/src/log.h   Tue Nov 16 09:37:01 2010
+++ /branches/experimental/isolates/src/log.h   Tue Jan 18 16:37:08 2011
@@ -297,6 +297,7 @@

  private:
   Logger();
+  ~Logger();

   // Size of window used for log records compression.
   static const int kCompressionWindowSize = 4;

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to