From 6f18cf74c5b796bc82ce44a4a85c67a3eea6b888 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Fri, 12 Sep 2025 15:03:52 +0100 Subject: [PATCH] Revert "refactor: App use Uniqueprt for SocketMultiplexer" This reverts commit 4d738b4784970e8de082489f6bc8b51029968d6b. --- src/lib/deskflow/App.h | 10 ++++------ src/lib/deskflow/ClientApp.cpp | 3 ++- src/lib/deskflow/ServerApp.cpp | 3 ++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/deskflow/App.h b/src/lib/deskflow/App.h index 208d6e90d..2dc5ce64f 100644 --- a/src/lib/deskflow/App.h +++ b/src/lib/deskflow/App.h @@ -11,7 +11,6 @@ #include "base/Log.h" #include "common/Common.h" #include "deskflow/IApp.h" -#include "net/SocketMultiplexer.h" #if SYSAPI_WIN32 #include "deskflow/win32/AppUtilWindows.h" @@ -19,7 +18,6 @@ #include "deskflow/unix/AppUtilUnix.h" #endif -#include #include namespace deskflow { @@ -93,14 +91,14 @@ public: { m_events = &events; } - void setSocketMultiplexer(std::unique_ptr &&sm) + void setSocketMultiplexer(SocketMultiplexer *sm) { - m_socketMultiplexer = std::move(sm); + m_socketMultiplexer = sm; } SocketMultiplexer *getSocketMultiplexer() const { - return m_socketMultiplexer.get(); + return m_socketMultiplexer; } static App &instance() @@ -121,7 +119,7 @@ private: static App *s_instance; FileLogOutputter *m_fileLog = nullptr; ARCH_APP_UTIL m_appUtil; - std::unique_ptr m_socketMultiplexer; + SocketMultiplexer *m_socketMultiplexer = nullptr; }; #if WINAPI_MSWINDOWS diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index 4110886c5..773a91e9c 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -372,7 +372,8 @@ int ClientApp::mainLoop() { // create socket multiplexer. this must happen after daemonization // on unix because threads evaporate across a fork(). - setSocketMultiplexer(std::make_unique()); + SocketMultiplexer multiplexer; + setSocketMultiplexer(&multiplexer); // start client, etc appUtil().startNode(); diff --git a/src/lib/deskflow/ServerApp.cpp b/src/lib/deskflow/ServerApp.cpp index 192d8ba90..475d95acb 100644 --- a/src/lib/deskflow/ServerApp.cpp +++ b/src/lib/deskflow/ServerApp.cpp @@ -574,7 +574,8 @@ int ServerApp::mainLoop() { // create socket multiplexer. this must happen after daemonization // on unix because threads evaporate across a fork(). - setSocketMultiplexer(std::make_unique()); + SocketMultiplexer multiplexer; + setSocketMultiplexer(&multiplexer); // if configuration has no screens then add this system // as the default