fix(volume): Cleanup mixers on early destruct

This commit is contained in:
Michael Carlberg 2016-06-21 16:33:21 +02:00
parent 1e5fc993a4
commit 04bd48d104
2 changed files with 10 additions and 0 deletions

View File

@ -44,6 +44,7 @@ namespace modules
public:
explicit VolumeModule(std::string name);
~VolumeModule();
bool has_event();
bool update();

View File

@ -88,6 +88,15 @@ VolumeModule::VolumeModule(std::string name_) : EventModule(name_)
// }}}
}
VolumeModule::~VolumeModule()
{
std::lock_guard<concurrency::SpinLock> 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;