From 3ec852b64cf07d00298253057a65f2bb308277ad Mon Sep 17 00:00:00 2001 From: weidai Date: Sat, 3 Feb 2007 13:29:09 +0000 Subject: [PATCH] fix threading bug --- osrng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osrng.cpp b/osrng.cpp index c310575c..52d1f537 100644 --- a/osrng.cpp +++ b/osrng.cpp @@ -85,7 +85,7 @@ void NonblockingRng::GenerateBlock(byte *output, size_t size) { #ifdef CRYPTOPP_WIN32_AVAILABLE # ifdef WORKAROUND_MS_BUG_Q258000 - static MicrosoftCryptoProvider m_Provider; + const MicrosoftCryptoProvider &m_Provider = Singleton().Ref(); # endif if (!CryptGenRandom(m_Provider.GetProviderHandle(), (DWORD)size, output)) throw OS_RNG_Err("CryptGenRandom");