diff --git a/ixwebsocket/IXSocketOpenSSL.cpp b/ixwebsocket/IXSocketOpenSSL.cpp index 2a14ef6d..a3e6906c 100644 --- a/ixwebsocket/IXSocketOpenSSL.cpp +++ b/ixwebsocket/IXSocketOpenSSL.cpp @@ -86,8 +86,7 @@ namespace ix std::atomic SocketOpenSSL::_openSSLInitializationSuccessful(false); std::once_flag SocketOpenSSL::_openSSLInitFlag; - std::unique_ptr SocketOpenSSL::_openSSLMutexes = - ix::make_unique(CRYPTO_num_locks()); + std::array openSSLMutexes; SocketOpenSSL::SocketOpenSSL(const SocketTLSOptions& tlsOptions, int fd) : Socket(fd) @@ -129,11 +128,11 @@ namespace ix { if (mode & CRYPTO_LOCK) { - _openSSLMutexes[type].lock(); + openSSLMutexes[type].lock(); } else { - _openSSLMutexes[type].unlock(); + openSSLMutexes[type].unlock(); } } diff --git a/ixwebsocket/IXSocketOpenSSL.h b/ixwebsocket/IXSocketOpenSSL.h index 92d9935a..dea1ffd6 100644 --- a/ixwebsocket/IXSocketOpenSSL.h +++ b/ixwebsocket/IXSocketOpenSSL.h @@ -61,7 +61,6 @@ namespace ix static std::once_flag _openSSLInitFlag; static std::atomic _openSSLInitializationSuccessful; - static std::unique_ptr _openSSLMutexes; }; } // namespace ix