Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Unified Diff: src/global-handles.cc

Issue 12260060: Add zapping of disposed persistent handles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 51e904e8a8df8a46b1b8502b63344a1901f05f81..691f81620e983b78321379a7f564038c569e76f9 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -113,6 +113,15 @@ class GlobalHandles::Node {
void Release(GlobalHandles* global_handles) {
ASSERT(state() != FREE);
set_state(FREE);
+#ifdef DEBUG
+ // Zap the values for eager trapping.
+ object_ = NULL;
+ class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
+ set_independent(false);
+ set_partially_dependent(false);
+ weak_reference_callback_ = NULL;
+ near_death_callback_ = NULL;
+#endif
parameter_or_next_free_.next_free = global_handles->first_free_;
global_handles->first_free_ = this;
DecreaseBlockUses(global_handles);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698