summaryrefslogtreecommitdiff
path: root/trdlocal.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-07-27 17:26:45 -0400
committerJeffrey Walton <noloader@gmail.com>2015-07-27 17:26:45 -0400
commitd76a974625a83c0d035bdd4ccb07e95c59921819 (patch)
tree77e5fcd91791a80dd2c0b3fd6fdb0127fb79066c /trdlocal.cpp
parent836cf237cf2e877e1841d69ade8248a9ddc54139 (diff)
downloadcryptopp-git-d76a974625a83c0d035bdd4ccb07e95c59921819.tar.gz
Added guard based on std::uncaught_exception so the class does not throw in an exception handler
Diffstat (limited to 'trdlocal.cpp')
-rw-r--r--trdlocal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/trdlocal.cpp b/trdlocal.cpp
index 6ca9222c..9c83e125 100644
--- a/trdlocal.cpp
+++ b/trdlocal.cpp
@@ -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
}