From 04bd48d104a299aacb810751e74e98e0e68a9afe Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 21 Jun 2016 16:33:21 +0200 Subject: [PATCH] fix(volume): Cleanup mixers on early destruct --- include/modules/volume.hpp | 1 + src/modules/volume.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/modules/volume.hpp b/include/modules/volume.hpp index 499199be..f4906007 100644 --- a/include/modules/volume.hpp +++ b/include/modules/volume.hpp @@ -44,6 +44,7 @@ namespace modules public: explicit VolumeModule(std::string name); + ~VolumeModule(); bool has_event(); bool update(); diff --git a/src/modules/volume.cpp b/src/modules/volume.cpp index 9aea2933..f265df1a 100644 --- a/src/modules/volume.cpp +++ b/src/modules/volume.cpp @@ -88,6 +88,15 @@ VolumeModule::VolumeModule(std::string name_) : EventModule(name_) // }}} } +VolumeModule::~VolumeModule() +{ + std::lock_guard lck(this->update_lock); + this->master_mixer.reset(); + this->speaker_mixer.reset(); + this->headphone_mixer.reset(); + this->headphone_ctrl.reset(); +} + bool VolumeModule::has_event() { bool has_event = false;