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

Unified Diff: runtime/platform/thread_win.cc

Issue 13470006: Only lookup and delete the monitor wait data if it was allocated. (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 | « no previous file | tests/standalone/standalone.status » ('j') | 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 662b376664f3a0503b61704a60776470daaf687e..6265f6f49f6eae798e3dd0b8664c20f777c1fb4c 100644
--- a/runtime/platform/thread_win.cc
+++ b/runtime/platform/thread_win.cc
@@ -174,12 +174,15 @@ 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;
+ if (MonitorWaitData::monitor_wait_data_key_ !=
+ Thread::kUnsetThreadLocalKey) {
+ 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;
+ }
}
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698