summaryrefslogtreecommitdiff
path: root/cryptlib.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-06-18 07:06:59 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-06-18 07:06:59 +0000
commite562437c88d18d206d079aa0ed07f5be57203a4a (patch)
tree2c3909fc3181e50ef34814d62769b02277bc13a5 /cryptlib.cpp
parent70a991f0023a3bd23bfd6ffd0b665f1dbed701bf (diff)
downloadcryptopp-e562437c88d18d206d079aa0ed07f5be57203a4a.tar.gz
fix possible race condition in Singleton::Ref()
tolerate double destruction of Singleton and g_nullNameValuePairs fix #include of standard headers git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@488 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r--cryptlib.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp
index 0e5bd24..dadd9ce 100644
--- a/cryptlib.cpp
+++ b/cryptlib.cpp
@@ -30,7 +30,14 @@ const std::string DEFAULT_CHANNEL;
const std::string AAD_CHANNEL = "AAD";
const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL;
-const NullNameValuePairs g_nullNameValuePairs;
+class NullNameValuePairs : public NameValuePairs
+{
+public:
+ bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const {return false;}
+};
+
+simple_ptr<NullNameValuePairs> s_pNullNameValuePairs(new NullNameValuePairs);
+const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p;
BufferedTransformation & TheBitBucket()
{