aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dabOutput/dabOutput.h7
-rw-r--r--src/dabOutput/dabOutputTcp.cpp10
2 files changed, 2 insertions, 15 deletions
diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h
index eaa623f..c10d358 100644
--- a/src/dabOutput/dabOutput.h
+++ b/src/dabOutput/dabOutput.h
@@ -222,11 +222,6 @@ class TCPDataDispatcher;
class DabOutputTcp : public DabOutput
{
public:
- DabOutputTcp() {}
- DabOutputTcp(const DabOutputTcp& other) = delete;
- const DabOutputTcp& operator=(const DabOutputTcp& other) = delete;
- ~DabOutputTcp();
-
int Open(const char* name);
int Write(void* buffer, int size);
int Close();
@@ -238,7 +233,7 @@ class DabOutputTcp : public DabOutput
private:
std::string uri_;
- TCPDataDispatcher* dispatcher_;
+ std::shared_ptr<TCPDataDispatcher> dispatcher_;
};
// -------------- Simul ------------------
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<TCPConnection> 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<TCPDataDispatcher>();
try {
dispatcher_->start(port, address);
}