mirror of https://github.com/polybar/polybar.git
fix: Acquire lock when stopping modules
This commit is contained in:
parent
5796bde25d
commit
df93cabf22
|
@ -210,13 +210,16 @@ namespace modules {
|
|||
}
|
||||
|
||||
void stop() {
|
||||
if (!enabled())
|
||||
return;
|
||||
m_log.trace("%s: Stop", name());
|
||||
enable(false);
|
||||
wakeup();
|
||||
if (!on_stop.empty())
|
||||
on_stop.emit(name());
|
||||
std::lock_guard<threading_util::spin_lock> lck(this->update_lock);
|
||||
{
|
||||
if (!enabled())
|
||||
return;
|
||||
m_log.trace("%s: Stop", name());
|
||||
enable(false);
|
||||
wakeup();
|
||||
if (!on_stop.empty())
|
||||
on_stop.emit(name());
|
||||
}
|
||||
}
|
||||
|
||||
void refresh() {
|
||||
|
|
|
@ -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