From e562437c88d18d206d079aa0ed07f5be57203a4a Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 18 Jun 2010 07:06:59 +0000 Subject: 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 --- cryptlib.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cryptlib.cpp') 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 s_pNullNameValuePairs(new NullNameValuePairs); +const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p; BufferedTransformation & TheBitBucket() { -- cgit v1.2.1