fix: Acquire lock when stopping modules
This commit is contained in:
parent
5796bde25d
commit
df93cabf22
@ -210,6 +210,8 @@ namespace modules {
|
||||
}
|
||||
|
||||
void stop() {
|
||||
std::lock_guard<threading_util::spin_lock> lck(this->update_lock);
|
||||
{
|
||||
if (!enabled())
|
||||
return;
|
||||
m_log.trace("%s: Stop", name());
|
||||
@ -218,6 +220,7 @@ namespace modules {
|
||||
if (!on_stop.empty())
|
||||
on_stop.emit(name());
|
||||
}
|
||||
}
|
||||
|
||||
void refresh() {
|
||||
m_cache = CAST_MODULE(Impl)->get_output();
|
||||
|
@ -17,14 +17,6 @@ namespace modules {
|
||||
public:
|
||||
using timer_module::timer_module;
|
||||
|
||||
~network_module() {
|
||||
std::lock_guard<threading_util::spin_lock> lck(this->update_lock);
|
||||
{
|
||||
m_wireless.reset();
|
||||
m_wired.reset();
|
||||
}
|
||||
}
|
||||
|
||||
void setup() {
|
||||
// Load configuration values
|
||||
REQ_CONFIG_VALUE(name(), m_interface, "interface");
|
||||
|
@ -108,19 +108,6 @@ namespace modules {
|
||||
// }}}
|
||||
}
|
||||
|
||||
void stop() {
|
||||
// Deconstruct all mixers before putting the module in its stopped state {{{
|
||||
|
||||
std::lock_guard<threading_util::spin_lock> lck(this->update_lock);
|
||||
m_mixers[mixer::MASTER].reset();
|
||||
m_mixers[mixer::SPEAKER].reset();
|
||||
m_mixers[mixer::HEADPHONE].reset();
|
||||
m_controls[control::HEADPHONE].reset();
|
||||
event_module::stop();
|
||||
|
||||
// }}}
|
||||
}
|
||||
|
||||
bool has_event() {
|
||||
// Poll for mixer and control events {{{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user