mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-20 03:35:41 +02:00
module/i3: take lock while updating ‘mode’
This commit is contained in:
parent
d9496152e3
commit
3da796810b
1 changed files with 8 additions and 3 deletions
|
@ -474,9 +474,14 @@ handle_mode_event(int type, const struct json_object *json, void *_mod)
|
|||
}
|
||||
|
||||
const char *current_mode = json_object_get_string(change);
|
||||
|
||||
mtx_lock(&mod->lock);
|
||||
{
|
||||
free(m->mode);
|
||||
m->mode = strdup(current_mode);
|
||||
m->dirty = true;
|
||||
}
|
||||
mtx_unlock(&mod->lock);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue