Add cleanup to LLCore prevent occasional crash on exit.

meow-7.2.2
Rider Linden 2015-09-21 17:01:26 -07:00
parent 1eed334e7f
commit 2a37a8b1cc
3 changed files with 19 additions and 0 deletions

View File

@ -350,6 +350,11 @@ void deallocateEasyCurl(CURL *curlp)
//static
void ssl_locking_callback(int mode, int type, const char *file, int line)
{
if (type >= sSSLMutex.size())
{
LL_WARNS() << "Attempt to get unknown MUTEX in SSL Lock." << LL_ENDL;
}
if (mode & CRYPTO_LOCK)
{
sSSLMutex[type]->lock();
@ -392,6 +397,18 @@ void initialize()
}
void cleanup()
{
#if SAFE_SSL
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);
sSSLMutex.clear();
#endif
curl_global_cleanup();
}
CURL_ptr createEasyHandle()
{
LLMutexLock lock(getCurlMutex());

View File

@ -497,6 +497,7 @@ namespace LLHttp
typedef boost::shared_ptr<CURL> CURL_ptr;
void initialize();
void cleanup();
CURL_ptr createEasyHandle();
std::string getCURLVersion();

View File

@ -2077,6 +2077,7 @@ bool LLAppViewer::cleanup()
}
LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL;
LLProxy::cleanupClass();
LLCore::LLHttp::cleanup();
LLWearableType::cleanupClass();