diff options
author | Like Ma <likemartinma@gmail.com> | 2015-09-17 11:37:06 +0800 |
---|---|---|
committer | Like Ma <likemartinma@gmail.com> | 2015-09-17 12:30:56 +0800 |
commit | 2472a1ec5e335f0032869ebc11ad269e0d64fcbc (patch) | |
tree | d897b6919da968f90fb42bb532b774e86b6a193b /ACE/ace/SSL | |
parent | a44a059aea4e965b7a0fb58490fb49e574b6d369 (diff) | |
download | ATCD-2472a1ec5e335f0032869ebc11ad269e0d64fcbc.tar.gz |
Add static ACE_SSL_Context::close for deleting it.
Because ACE_SSL_Context is a unmanaged singleton, it would not
destruct without calling static close method explicitly.
Diffstat (limited to 'ACE/ace/SSL')
-rw-r--r-- | ACE/ace/SSL/SSL_Context.cpp | 6 | ||||
-rw-r--r-- | ACE/ace/SSL/SSL_Context.h | 3 | ||||
-rw-r--r-- | ACE/ace/SSL/SSL_Initializer.cpp | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/ACE/ace/SSL/SSL_Context.cpp b/ACE/ace/SSL/SSL_Context.cpp index 6f4ccabc17b..9212ffe1c93 100644 --- a/ACE/ace/SSL/SSL_Context.cpp +++ b/ACE/ace/SSL/SSL_Context.cpp @@ -135,6 +135,12 @@ ACE_SSL_Context::instance (void) } void +ACE_SSL_Context::close (void) +{ + ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::close (); +} + +void ACE_SSL_Context::ssl_library_init (void) { ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, diff --git a/ACE/ace/SSL/SSL_Context.h b/ACE/ace/SSL/SSL_Context.h index 9dc1958ff59..13932efab29 100644 --- a/ACE/ace/SSL/SSL_Context.h +++ b/ACE/ace/SSL/SSL_Context.h @@ -136,6 +136,9 @@ public: /// nothing else is available. static ACE_SSL_Context *instance (void); + /// Explicitly delete the Singleton context. + static void close (void); + /** * Set the CTX mode. The mode can be set only once, afterwards the * function has no effect and returns -1. diff --git a/ACE/ace/SSL/SSL_Initializer.cpp b/ACE/ace/SSL/SSL_Initializer.cpp index b4baac0bc77..d1b82afd359 100644 --- a/ACE/ace/SSL/SSL_Initializer.cpp +++ b/ACE/ace/SSL/SSL_Initializer.cpp @@ -25,7 +25,7 @@ int ACE_SSL_Initializer::fini (void) { // Explicitly close the ACE_SSL_Context singleton. - ACE_Unmanaged_Singleton<ACE_SSL_Context, ACE_SYNCH_MUTEX>::close(); + ACE_SSL_Context::close (); return 0; } |