diff options
-rw-r--r-- | src/StatsPublish.cpp | 7 | ||||
-rw-r--r-- | src/StatsPublish.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/StatsPublish.cpp b/src/StatsPublish.cpp index 0bad833..cdb32cb 100644 --- a/src/StatsPublish.cpp +++ b/src/StatsPublish.cpp @@ -51,6 +51,13 @@ StatsPublisher::StatsPublisher(const string& socket_path) : } } +StatsPublisher::~StatsPublisher() +{ + if (m_sock != -1) { + close(m_sock); + } +} + void StatsPublisher::update_audio_levels(int16_t audiolevel_left, int16_t audiolevel_right) { m_audio_left = audiolevel_left; diff --git a/src/StatsPublish.h b/src/StatsPublish.h index f593c7c..7ff7da4 100644 --- a/src/StatsPublish.h +++ b/src/StatsPublish.h @@ -34,6 +34,9 @@ class StatsPublisher { public: StatsPublisher(const std::string& socket_path); + StatsPublisher(const StatsPublisher& other) = delete; + StatsPublisher& operator=(const StatsPublisher& other) = delete; + ~StatsPublisher(); /*! Update peak audio level information */ void update_audio_levels(int16_t audiolevel_left, int16_t audiolevel_right); |