diff options
Diffstat (limited to 'src/Platform/Win32/Tss.c')
| -rw-r--r-- | src/Platform/Win32/Tss.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Platform/Win32/Tss.c b/src/Platform/Win32/Tss.c index 7d8a1b3..584bc46 100644 --- a/src/Platform/Win32/Tss.c +++ b/src/Platform/Win32/Tss.c @@ -18,12 +18,19 @@ static void __stdcall BH_TssKeyCleanup(void *data) { int i; + /* Skip or remove TSS data */ + if (!data) + return; + else if (FlsSetValue(tssKey, NULL)) + abort(); + /* Lock cleanup table and call cleanups */ BH_SpinlockLock(&tssCleanupLock); for (i = 0; i < tssCleanupSize; i++) tssCleanupData[i](((void **)data)[i]); BH_SpinlockUnlock(&tssCleanupLock); + /* Deallocate TSS data */ free(data); } |
