diff options
Diffstat (limited to 'src/zenserver/proxy/zenproxyserver.cpp')
| -rw-r--r-- | src/zenserver/proxy/zenproxyserver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zenserver/proxy/zenproxyserver.cpp b/src/zenserver/proxy/zenproxyserver.cpp index 1fd9cd2c4..acfdad45f 100644 --- a/src/zenserver/proxy/zenproxyserver.cpp +++ b/src/zenserver/proxy/zenproxyserver.cpp @@ -302,7 +302,7 @@ ZenProxyServer::Initialize(const ZenProxyServerConfig& ServerConfig, ZenServerSt // Keep the io_context alive even when there is no pending work, so that // worker threads don't exit prematurely between async operations. - m_ProxyIoWorkGuard = std::make_unique<asio::io_context::work>(m_ProxyIoContext); + m_ProxyIoWorkGuard.emplace(m_ProxyIoContext.get_executor()); // Start proxy I/O worker threads. Use a modest thread count — proxy work is // I/O-bound so we don't need a thread per core, but having more than one @@ -404,7 +404,7 @@ ZenProxyServer::Cleanup() Service->Stop(); } - m_ProxyIoWorkGuard.reset(); + m_ProxyIoWorkGuard.reset(); // releases the work guard, allowing io_context to finish m_ProxyIoContext.stop(); for (auto& Thread : m_ProxyIoThreads) { |