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

Unified Diff: Source/platform/heap/Handle.h

Issue 1275863002: Oilpan: catch some self-referential leaks (main thread.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add stdio.h include Created 5 years, 4 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 | Source/platform/heap/PersistentNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Handle.h
diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
index d3a1cc23de41db114edbae4e6c19e368a1bde476..e124b80fffbc9d3508eb84aed57a5510831d5a64 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -948,6 +948,10 @@ public:
void clear()
{
+#if ENABLE(ASSERT)
+ if (m_keepAlive)
+ ThreadState::decrementSelfKeepAliveAllocations();
+#endif
m_keepAlive.clear();
}
@@ -958,8 +962,12 @@ private:
void assign(Self* self)
{
ASSERT(!m_keepAlive || m_keepAlive->get() == self);
- if (!m_keepAlive)
+ if (!m_keepAlive) {
m_keepAlive = adoptPtr(new Persistent<Self>);
+#if ENABLE(ASSERT)
+ ThreadState::incrementSelfKeepAliveAllocations();
+#endif
+ }
*m_keepAlive = self;
}
« no previous file with comments | « no previous file | Source/platform/heap/PersistentNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698