refactor: destroy threads first

This commit is contained in:
Alex
2019-05-29 17:53:22 +02:00
parent b05d4cd413
commit fcf2d18a01
12 changed files with 64 additions and 55 deletions

View File

@ -25,14 +25,14 @@ void waybar::modules::Custom::delayWorker() {
thread_ = [this] {
bool can_update = true;
if (config_["exec-if"].isString()) {
auto res = waybar::util::command::exec(config_["exec-if"].asString());
auto res = util::command::exec(config_["exec-if"].asString());
if (res.exit_code != 0) {
can_update = false;
event_box_.hide();
}
}
if (can_update) {
output_ = waybar::util::command::exec(config_["exec"].asString());
output_ = util::command::exec(config_["exec"].asString());
dp.emit();
}
thread_.sleep_for(interval_);