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

Unified Diff: src/v8threads.cc

Issue 251014: * Fix memory leaks caused by thread local data being lost.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 3 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 | « src/v8threads.h ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8threads.cc
===================================================================
--- src/v8threads.cc (revision 2968)
+++ src/v8threads.cc (working copy)
@@ -77,7 +77,9 @@
Locker::~Locker() {
ASSERT(internal::ThreadManager::IsLockedByCurrentThread());
if (has_lock_) {
- if (!top_level_) {
+ if (top_level_) {
+ internal::ThreadManager::FreeThreadResources();
+ } else {
internal::ThreadManager::ArchiveThread();
}
internal::ThreadManager::Unlock();
@@ -284,6 +286,18 @@
}
+void ThreadManager::FreeThreadResources() {
+ HandleScopeImplementer::FreeThreadResources();
+ Top::FreeThreadResources();
+#ifdef ENABLE_DEBUGGER_SUPPORT
+ Debug::FreeThreadResources();
+#endif
+ StackGuard::FreeThreadResources();
+ RegExpStack::FreeThreadResources();
+ Bootstrapper::FreeThreadResources();
+}
+
+
bool ThreadManager::IsArchived() {
return Thread::HasThreadLocal(thread_state_key);
}
« no previous file with comments | « src/v8threads.h ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698