Skip to content

Commit 4dba4ff

Browse files
authored
Serevr: Allocate socket instances with std::make_shared (#793)
std::move() transfers them fine, but this was an unintentional oversight after things were changed. They should (now) just be allocated as shared in the first place.
1 parent dd88611 commit 4dba4ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Server/shared-server/TcpClientSocketManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TcpClientSocketManager : public TcpSocketManager
1818
if (_inactiveSocketArray[i] != nullptr)
1919
continue;
2020

21-
auto tcpSocket = std::make_unique<T>(std::forward<Args>(args)..., this);
21+
auto tcpSocket = std::make_shared<T>(std::forward<Args>(args)..., this);
2222
if (tcpSocket == nullptr)
2323
return false;
2424

src/Server/shared-server/TcpServerSocketManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TcpServerSocketManager : public TcpSocketManager
1818
if (_inactiveSocketArray[i] != nullptr)
1919
continue;
2020

21-
auto tcpSocket = std::make_unique<T>(std::forward<Args>(args)..., this);
21+
auto tcpSocket = std::make_shared<T>(std::forward<Args>(args)..., this);
2222
if (tcpSocket == nullptr)
2323
return false;
2424

0 commit comments

Comments
 (0)