Revision: 16606
Author:   dcar...@chromium.org
Date:     Tue Sep 10 09:24:53 2013 UTC
Log:      restore persistent dtor

R=svenpa...@chromium.org
BUG=

Review URL: https://codereview.chromium.org/23581010
http://code.google.com/p/v8/source/detail?r=16606

Modified:
 /branches/bleeding_edge/include/v8.h
 /branches/bleeding_edge/test/cctest/test-api.cc

=======================================
--- /branches/bleeding_edge/include/v8.h        Tue Sep 10 06:43:23 2013 UTC
+++ /branches/bleeding_edge/include/v8.h        Tue Sep 10 09:24:53 2013 UTC
@@ -544,6 +544,14 @@
     Copy(that);
     return *this;
   }
+  /**
+   * The destructor will dispose the Persistent based on the
+ * kResetInDestructor flags in the traits class. Since not calling dispose + * can result in a memory leak, it is recommended to always set this flag.
+   */
+  V8_INLINE(~Persistent()) {
+    if (M::kResetInDestructor) Reset();
+  }

   /**
    * If non-empty, destroy the underlying storage cell
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Mon Sep 9 10:10:26 2013 UTC +++ /branches/bleeding_edge/test/cctest/test-api.cc Tue Sep 10 09:24:53 2013 UTC
@@ -12700,7 +12700,7 @@
     CHECK_EQ(initial_handles + 3, globals->global_handles_count());
   }
   // Verify autodispose
-//  CHECK_EQ(initial_handles, globals->global_handles_count());
+  CHECK_EQ(initial_handles, globals->global_handles_count());
 }


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to