mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-25 06:36:37 +01:00
GH #159: Crash in openssl CRYPTO_thread_id()
GH #159: Crash in openssl CRYPTO_thread_id() after library libPocoCrypto.so has been unloaded.
This commit is contained in:
@@ -92,7 +92,9 @@ void OpenSSLInitializer::initialize()
|
|||||||
int nMutexes = CRYPTO_num_locks();
|
int nMutexes = CRYPTO_num_locks();
|
||||||
_mutexes = new Poco::FastMutex[nMutexes];
|
_mutexes = new Poco::FastMutex[nMutexes];
|
||||||
CRYPTO_set_locking_callback(&OpenSSLInitializer::lock);
|
CRYPTO_set_locking_callback(&OpenSSLInitializer::lock);
|
||||||
#ifndef POCO_OS_FAMILY_WINDOWS // SF# 1828231: random unhandled exceptions when linking with ssl
|
// not needed on windows
|
||||||
|
// (see SF# 1828231: random unhandled exceptions when linking with ssl)
|
||||||
|
#ifndef POCO_OS_FAMILY_WINDOWS
|
||||||
CRYPTO_set_id_callback(&OpenSSLInitializer::id);
|
CRYPTO_set_id_callback(&OpenSSLInitializer::id);
|
||||||
#endif
|
#endif
|
||||||
CRYPTO_set_dynlock_create_callback(&OpenSSLInitializer::dynlockCreate);
|
CRYPTO_set_dynlock_create_callback(&OpenSSLInitializer::dynlockCreate);
|
||||||
@@ -111,6 +113,11 @@ void OpenSSLInitializer::uninitialize()
|
|||||||
EVP_cleanup();
|
EVP_cleanup();
|
||||||
ERR_free_strings();
|
ERR_free_strings();
|
||||||
CRYPTO_set_locking_callback(0);
|
CRYPTO_set_locking_callback(0);
|
||||||
|
// not needed on windows
|
||||||
|
// (see SF# 1828231: random unhandled exceptions when linking with ssl)
|
||||||
|
#ifndef POCO_OS_FAMILY_WINDOWS
|
||||||
|
CRYPTO_set_id_callback(0);
|
||||||
|
#endif
|
||||||
delete [] _mutexes;
|
delete [] _mutexes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user