mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #2184 from lfos/fix-battery-segfault
Fix SEGFAULT in battery module
This commit is contained in:
commit
7b0d2e8043
@ -36,7 +36,8 @@ waybar::modules::Battery::~Battery() {
|
|||||||
}
|
}
|
||||||
close(global_watch_fd_);
|
close(global_watch_fd_);
|
||||||
|
|
||||||
for (auto it = batteries_.cbegin(); it != batteries_.cend(); it++) {
|
for (auto it = batteries_.cbegin(), next_it = it; it != batteries_.cend(); it = next_it) {
|
||||||
|
++next_it;
|
||||||
auto watch_id = (*it).second;
|
auto watch_id = (*it).second;
|
||||||
if (watch_id >= 0) {
|
if (watch_id >= 0) {
|
||||||
inotify_rm_watch(battery_watch_fd_, watch_id);
|
inotify_rm_watch(battery_watch_fd_, watch_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user