From 02de91f7f2e2db8b137266d13fa0a7b688fc5132 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 20 Mar 2015 16:04:48 -0400 Subject: [PATCH] use unique_ptr for socket in I2PTunnelConnection --- I2PTunnel.cpp | 1 - I2PTunnel.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/I2PTunnel.cpp b/I2PTunnel.cpp index 3eb89f45..51392819 100644 --- a/I2PTunnel.cpp +++ b/I2PTunnel.cpp @@ -33,7 +33,6 @@ namespace client I2PTunnelConnection::~I2PTunnelConnection () { - delete m_Socket; } void I2PTunnelConnection::I2PConnect (const uint8_t * msg, size_t len) diff --git a/I2PTunnel.h b/I2PTunnel.h index 41a067f8..39136587 100644 --- a/I2PTunnel.h +++ b/I2PTunnel.h @@ -49,7 +49,7 @@ namespace client private: uint8_t m_Buffer[I2P_TUNNEL_CONNECTION_BUFFER_SIZE], m_StreamBuffer[I2P_TUNNEL_CONNECTION_BUFFER_SIZE]; - boost::asio::ip::tcp::socket * m_Socket; + std::unique_ptr m_Socket; std::shared_ptr m_Stream; boost::asio::ip::tcp::endpoint m_RemoteEndpoint; bool m_IsQuiet; // don't send destination