diff --git a/common/eda_dde.cpp b/common/eda_dde.cpp index 5a99c21221..6dad2603e2 100644 --- a/common/eda_dde.cpp +++ b/common/eda_dde.cpp @@ -301,7 +301,6 @@ private: std::unique_ptr socketHolder = nullptr; -std::once_flag socketHolderCreated; /* Used by a client to sent (by a socket connection) a data to a server. * - Open a Socket Client connection @@ -312,8 +311,8 @@ std::once_flag socketHolderCreated; */ bool SendCommand( int aService, const std::string& aMessage ) { - std::call_once( socketHolderCreated, - []() { socketHolder.reset( new ASYNC_SOCKET_HOLDER() ); } ); + if( !socketHolder ) + socketHolder.reset( new ASYNC_SOCKET_HOLDER() ); return socketHolder->Send( aService, aMessage ); }