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

Unified Diff: base/threading/platform_thread_win.cc

Issue 75133004: Close duplicated handle on windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index e9752ba21394c671d1d84214e4cd65078bd940f3..daa6dc7c99f2e11cfa8b713b79a8214999eee635 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -76,6 +76,19 @@ DWORD __stdcall ThreadFunc(void* params) {
ThreadIdNameManager::GetInstance()->RemoveName(
platform_handle,
PlatformThread::CurrentId());
+
+ /* Close the duplicated handle created for the thread name mapping. */
+ DuplicateHandle(
+ GetCurrentProcess(),
+ platform_handle,
+ GetCurrentProcess(),
+ NULL,
zhaoqin 2013/11/26 20:35:56 This NULL will cause a handle leak. It seems that
dsinclair 2013/11/28 15:51:14 Done.
+ 0,
+ FALSE,
+ DUPLICATE_CLOSE_SOURCE);
+
+ CloseHandle(platform_handle);
zhaoqin 2013/11/26 20:35:56 If you use DUPLICATE_CLOSE_SOURCE above in Duplica
dsinclair 2013/11/28 15:51:14 Done.
+
return NULL;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698