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;