This leak is a slow leak on Windows caused by the way that TlsSetValue works. If the current context is assigned for a thread and never unassigned, then the shared pointer allocated for that thread could potentially not be freed, resulting in the leak.
Fix this issue by using FlsSetValue instead, which allows a teardown routine to be specified. On platforms that do not support this function, fall back to the old behavior.
This leak is a slow leak on Windows caused by the way that
TlsSetValue
works. If the current context is assigned for a thread and never unassigned, then the shared pointer allocated for that thread could potentially not be freed, resulting in the leak.Fix this issue by using
FlsSetValue
instead, which allows a teardown routine to be specified. On platforms that do not support this function, fall back to the old behavior.