From a2345d1f45870eb00a2a3d5d6fd21a386efcade3 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 27 Jan 2019 17:01:35 +0500 Subject: Replaced "new/delete" with safer analogues --- src/Network.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Network.hpp') diff --git a/src/Network.hpp b/src/Network.hpp index 5d7fc38..29a090f 100644 --- a/src/Network.hpp +++ b/src/Network.hpp @@ -11,12 +11,13 @@ enum ConnectionState : unsigned char { }; class Network { - Socket *socket = nullptr; - StreamSocket *stream = nullptr; + std::unique_ptr socket; + std::unique_ptr stream; std::shared_ptr ReceivePacketByPacketId(int packetId, ConnectionState state, StreamInput &stream); public: Network(std::string address, unsigned short port); + ~Network(); std::shared_ptr ReceivePacket(ConnectionState state = Play, bool useCompression = false); -- cgit v1.2.3