mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Run TLS destructor after clearing TLS value, as per standard
This commit is contained in:
parent
6c194fc6a6
commit
21de119c68
@ -144,9 +144,10 @@ void threadExit(void) {
|
||||
if (!(tls_mask & ((UINT64_C(1) << i))))
|
||||
continue;
|
||||
if (t->tls_array[i]) {
|
||||
if (g_tlsDestructors[i])
|
||||
g_tlsDestructors[i](t->tls_array[i]);
|
||||
void* old_value = t->tls_array[i];
|
||||
t->tls_array[i] = NULL;
|
||||
if (g_tlsDestructors[i])
|
||||
g_tlsDestructors[i](old_value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user