Revert "refactor: App use Uniqueprt for SocketMultiplexer"

This reverts commit 4d738b4784.
This commit is contained in:
Nick Bolton 2025-09-12 15:03:52 +01:00
parent 162cb85811
commit 6f18cf74c5
3 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,6 @@
#include "base/Log.h" #include "base/Log.h"
#include "common/Common.h" #include "common/Common.h"
#include "deskflow/IApp.h" #include "deskflow/IApp.h"
#include "net/SocketMultiplexer.h"
#if SYSAPI_WIN32 #if SYSAPI_WIN32
#include "deskflow/win32/AppUtilWindows.h" #include "deskflow/win32/AppUtilWindows.h"
@ -19,7 +18,6 @@
#include "deskflow/unix/AppUtilUnix.h" #include "deskflow/unix/AppUtilUnix.h"
#endif #endif
#include <memory>
#include <stdexcept> #include <stdexcept>
namespace deskflow { namespace deskflow {
@ -93,14 +91,14 @@ public:
{ {
m_events = &events; m_events = &events;
} }
void setSocketMultiplexer(std::unique_ptr<SocketMultiplexer> &&sm) void setSocketMultiplexer(SocketMultiplexer *sm)
{ {
m_socketMultiplexer = std::move(sm); m_socketMultiplexer = sm;
} }
SocketMultiplexer *getSocketMultiplexer() const SocketMultiplexer *getSocketMultiplexer() const
{ {
return m_socketMultiplexer.get(); return m_socketMultiplexer;
} }
static App &instance() static App &instance()
@ -121,7 +119,7 @@ private:
static App *s_instance; static App *s_instance;
FileLogOutputter *m_fileLog = nullptr; FileLogOutputter *m_fileLog = nullptr;
ARCH_APP_UTIL m_appUtil; ARCH_APP_UTIL m_appUtil;
std::unique_ptr<SocketMultiplexer> m_socketMultiplexer; SocketMultiplexer *m_socketMultiplexer = nullptr;
}; };
#if WINAPI_MSWINDOWS #if WINAPI_MSWINDOWS

View file

@ -372,7 +372,8 @@ int ClientApp::mainLoop()
{ {
// create socket multiplexer. this must happen after daemonization // create socket multiplexer. this must happen after daemonization
// on unix because threads evaporate across a fork(). // on unix because threads evaporate across a fork().
setSocketMultiplexer(std::make_unique<SocketMultiplexer>()); SocketMultiplexer multiplexer;
setSocketMultiplexer(&multiplexer);
// start client, etc // start client, etc
appUtil().startNode(); appUtil().startNode();

View file

@ -574,7 +574,8 @@ int ServerApp::mainLoop()
{ {
// create socket multiplexer. this must happen after daemonization // create socket multiplexer. this must happen after daemonization
// on unix because threads evaporate across a fork(). // on unix because threads evaporate across a fork().
setSocketMultiplexer(std::make_unique<SocketMultiplexer>()); SocketMultiplexer multiplexer;
setSocketMultiplexer(&multiplexer);
// if configuration has no screens then add this system // if configuration has no screens then add this system
// as the default // as the default