mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 04:52:39 +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))))
|
if (!(tls_mask & ((UINT64_C(1) << i))))
|
||||||
continue;
|
continue;
|
||||||
if (t->tls_array[i]) {
|
if (t->tls_array[i]) {
|
||||||
if (g_tlsDestructors[i])
|
void* old_value = t->tls_array[i];
|
||||||
g_tlsDestructors[i](t->tls_array[i]);
|
|
||||||
t->tls_array[i] = NULL;
|
t->tls_array[i] = NULL;
|
||||||
|
if (g_tlsDestructors[i])
|
||||||
|
g_tlsDestructors[i](old_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user