diff options
Diffstat (limited to 'io/source/acceptor')
-rw-r--r-- | io/source/acceptor/acc_pipe.cxx | 5 | ||||
-rw-r--r-- | io/source/acceptor/acc_socket.cxx | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx index 4410760c6f26..50a9939a2144 100644 --- a/io/source/acceptor/acc_pipe.cxx +++ b/io/source/acceptor/acc_pipe.cxx @@ -148,19 +148,18 @@ namespace io_acceptor OUString error = "io.acceptor: pipe already closed" + m_sPipeName; throw ConnectionSetupException( error ); } - PipeConnection *pConn = new PipeConnection( m_sConnectionDescription ); + std::unique_ptr<PipeConnection> pConn(new PipeConnection( m_sConnectionDescription )); oslPipeError status = pipe.accept( pConn->m_pipe ); if( m_bClosed ) { // stopAccepting was called ! - delete pConn; return Reference < XConnection >(); } else if( osl_Pipe_E_None == status ) { - return Reference < XConnection > ( static_cast<XConnection *>(pConn) ); + return Reference < XConnection > ( static_cast<XConnection *>(pConn.release()) ); } else { diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx index f34b3635eb7b..5a9956eb75d9 100644 --- a/io/source/acceptor/acc_socket.cxx +++ b/io/source/acceptor/acc_socket.cxx @@ -330,17 +330,15 @@ namespace io_acceptor { Reference< XConnection > SocketAcceptor::accept( ) { - SocketConnection *pConn = new SocketConnection( m_sConnectionDescription ); + std::unique_ptr<SocketConnection> pConn(new SocketConnection( m_sConnectionDescription )); if( m_socket.acceptConnection( pConn->m_socket )!= osl_Socket_Ok ) { // stopAccepting was called - delete pConn; return Reference < XConnection > (); } if( m_bClosed ) { - delete pConn; return Reference < XConnection > (); } @@ -358,7 +356,7 @@ namespace io_acceptor { sizeof( nTcpNoDelay ) , osl_Socket_LevelTcp ); } - return Reference < XConnection > ( static_cast<XConnection *>(pConn) ); + return Reference < XConnection > ( static_cast<XConnection *>(pConn.release()) ); } void SocketAcceptor::stopAccepting() |