Skip to content

Commit 6787b8a

Browse files
authored
Merge pull request #2902 from readdle/tls-cleanup
[Windows] Fix thread local storage cleanup
2 parents 39c982f + 07f9c61 commit 6787b8a

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

CoreFoundation/Base.subproj/CFPlatform.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -663,16 +663,6 @@ CF_PRIVATE void __CFTSDWindowsCleanup() {
663663
FlsFree(__CFTSDIndexKey);
664664
}
665665

666-
// Called for each thread as it exits, on Windows only
667-
CF_PRIVATE void __CFFinalizeWindowsThreadData() {
668-
// Normally, this should call the finalizer several times to emulate the behavior of pthreads on Windows. However, a few bugs keep us from doing this:
669-
// <rdar://problem/8989063> REGRESSION(CF-610-CF-611): Crash closing Safari in BonjourDB destructor (Windows)
670-
// <rdar://problem/9326814> SyncUIHandler crashes after conflict is resolved and we do SyncNow
671-
// and a bug in dispatch keeps us from using pthreadsWin32 directly, because it does not deal with the case of a dispatch_async happening during process exit (it attempts to create a thread, but that is illegal on Win32 and causes a hang).
672-
// So instead we just finalize once, which is the behavior pre-Airwolf anyway
673-
__CFTSDFinalize(TlsGetValue(__CFTSDIndexKey));
674-
}
675-
676666
#else
677667

678668
static _CFThreadSpecificKey __CFTSDIndexKey;

CoreFoundation/Base.subproj/CFRuntime.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ CF_PRIVATE void __CFTSDInitialize(void);
978978
#if TARGET_OS_WIN32
979979
// From CFPlatform.c
980980
CF_PRIVATE void __CFTSDWindowsCleanup(void);
981-
CF_PRIVATE void __CFFinalizeWindowsThreadData(void);
982981
#endif
983982

984983
#if TARGET_OS_MAC
@@ -1352,8 +1351,6 @@ int DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID pReserved ) {
13521351
// do these last
13531352
if (cfBundle) CFRelease(cfBundle);
13541353
__CFStringCleanup();
1355-
} else if (dwReason == DLL_THREAD_DETACH) {
1356-
__CFFinalizeWindowsThreadData();
13571354
}
13581355
return TRUE;
13591356
}

0 commit comments

Comments
 (0)