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

Unified Diff: runtime/platform/thread_win.cc

Issue 12646007: Fix file descriptor leak in event handler implementation. When shutting down an isolate, we did not… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « runtime/platform/thread_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/thread_win.cc
diff --git a/runtime/platform/thread_win.cc b/runtime/platform/thread_win.cc
index 18ec6d0bdb2a3feecfd4d8af19ab66049285bedf..662b376664f3a0503b61704a60776470daaf687e 100644
--- a/runtime/platform/thread_win.cc
+++ b/runtime/platform/thread_win.cc
@@ -42,8 +42,8 @@ static unsigned int __stdcall ThreadEntry(void* data_ptr) {
// Call the supplied thread start function handing it its parameters.
function(parameter);
- // When the function returns here close the handle.
- CloseHandle(GetCurrentThread());
+ // Clean up the monitor wait data for this thread.
+ MonitorWaitData::ThreadExit();
return 0;
}
@@ -173,6 +173,17 @@ void Monitor::Exit() {
}
+void MonitorWaitData::ThreadExit() {
+ uword raw_wait_data =
+ Thread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
+ if (raw_wait_data != 0) {
+ MonitorWaitData* wait_data =
+ reinterpret_cast<MonitorWaitData*>(raw_wait_data);
+ delete wait_data;
+ }
+}
+
+
void MonitorData::AddWaiter(MonitorWaitData* wait_data) {
// Add the MonitorWaitData object to the list of objects waiting for
// this monitor.
« no previous file with comments | « runtime/platform/thread_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698