Commit dcc93c91 authored by dcarney@chromium.org's avatar dcarney@chromium.org

restore persistent dtor

R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16606 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d571a91e
...@@ -544,6 +544,14 @@ template <class T, class M> class Persistent { ...@@ -544,6 +544,14 @@ template <class T, class M> class Persistent {
Copy(that); Copy(that);
return *this; 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 * If non-empty, destroy the underlying storage cell
......
...@@ -12700,7 +12700,7 @@ TEST(CopyablePersistent) { ...@@ -12700,7 +12700,7 @@ TEST(CopyablePersistent) {
CHECK_EQ(initial_handles + 3, globals->global_handles_count()); CHECK_EQ(initial_handles + 3, globals->global_handles_count());
} }
// Verify autodispose // Verify autodispose
// CHECK_EQ(initial_handles, globals->global_handles_count()); CHECK_EQ(initial_handles, globals->global_handles_count());
} }
......
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