Added guard based on std::uncaught_exception so the class does not throw in an exception handler
parent
836cf237cf
commit
d76a974625
|
|
@ -36,11 +36,11 @@ ThreadLocalStorage::ThreadLocalStorage()
|
|||
ThreadLocalStorage::~ThreadLocalStorage() CRYPTOPP_THROW
|
||||
{
|
||||
#ifdef HAS_WINTHREADS
|
||||
if (!TlsFree(m_index))
|
||||
if (!TlsFree(m_index) && !std::uncaught_exception())
|
||||
throw Err("TlsFree", GetLastError());
|
||||
#else
|
||||
int error = pthread_key_delete(m_index);
|
||||
if (error)
|
||||
if (error && !std::uncaught_exception())
|
||||
throw Err("pthread_key_delete", error);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue