Index: base/threading/platform_thread_win.cc |
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc |
index dc36a140447a68523fd1f58be0aef64715fae33c..25973bcada928651091da0fa7025356f34604602 100644 |
--- a/base/threading/platform_thread_win.cc |
+++ b/base/threading/platform_thread_win.cc |
@@ -114,15 +114,17 @@ |
// have to work running on CreateThread() threads anyway, since we run code |
// on the Windows thread pool, etc. For some background on the difference: |
// http://www.microsoft.com/msj/1099/win32/win321099.aspx |
- base::win::ScopedHandle thread_handle( |
- ::CreateThread(nullptr, stack_size, ThreadFunc, params, flags, nullptr)); |
- if (!thread_handle.IsValid()) { |
+ void* thread_handle = |
+ ::CreateThread(nullptr, stack_size, ThreadFunc, params, flags, nullptr); |
+ if (!thread_handle) { |
delete params; |
return false; |
} |
if (out_thread_handle) |
- *out_thread_handle = PlatformThreadHandle(thread_handle.Take()); |
+ *out_thread_handle = PlatformThreadHandle(thread_handle); |
+ else |
+ CloseHandle(thread_handle); |
return true; |
} |