From 90d77644cf5a715379019e4f09cb5868a02f3c69 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 30 Oct 2016 12:23:54 +0100 Subject: Avoid manual pointer management of the TCPDataDispatcher --- src/dabOutput/dabOutputTcp.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/dabOutput/dabOutputTcp.cpp') diff --git a/src/dabOutput/dabOutputTcp.cpp b/src/dabOutput/dabOutputTcp.cpp index 6485d15..94d379e 100644 --- a/src/dabOutput/dabOutputTcp.cpp +++ b/src/dabOutput/dabOutputTcp.cpp @@ -151,14 +151,6 @@ class TCPDataDispatcher std::list m_connections; }; -DabOutputTcp::~DabOutputTcp() -{ - if (dispatcher_) { - delete dispatcher_; - dispatcher_ = nullptr; - } -} - static bool parse_uri(const char *uri, long *port, string& addr) { char* const hostport = strdup(uri); // the uri is actually an tuple host:port @@ -205,7 +197,7 @@ int DabOutputTcp::Open(const char* name) uri_ = name; if (success) { - dispatcher_ = new TCPDataDispatcher(); + dispatcher_ = make_shared(); try { dispatcher_->start(port, address); } -- cgit v1.2.3