fix(Workspaces): check thread is running before parse response
parent
171e0e5ae3
commit
f8116132a7
|
@ -28,7 +28,9 @@ void waybar::modules::sway::Workspaces::worker()
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
auto res = ipc_.sendCmd(IPC_GET_WORKSPACES);
|
auto res = ipc_.sendCmd(IPC_GET_WORKSPACES);
|
||||||
workspaces_ = parser_.parse(res.payload);
|
if (thread_.isRunning()) {
|
||||||
|
workspaces_ = parser_.parse(res.payload);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dp.emit();
|
dp.emit();
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
|
|
Loading…
Reference in New Issue