Lukas Fleischer 75eacb95ef Fix SEGFAULT in battery module
In waybar::modules::Battery::~Battery(), store a copy of the batteries_
iterator before calling erase(), as erase() invalidates the iterator.

Prior to this change, disconnecting outputs resulted in a SEGFAULT when
using the battery module; e.g.,

    [debug] Received SIGCHLD in signalThread
    [debug] Cmd exited with code 0
    [debug] Received SIGCHLD in signalThread
    [debug] Cmd exited with code 0
    [debug] Received SIGCHLD in signalThread
    [debug] Cmd exited with code 0
    [debug] Output removed: AU Optronics 0x2336
    [info] Bar configured (width: 1280, height: 25) for output: eDP-1
    [info] Bar configured (width: 1280, height: 25) for output: eDP-1
    zsh: segmentation fault (core dumped)  ./build/waybar -l trace

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
2023-05-22 10:16:30 -04:00
..
2023-04-17 09:01:14 +02:00
2023-03-08 14:35:07 +00:00
2023-05-10 13:43:43 +02:00
2022-12-01 08:45:12 +01:00
2023-05-05 08:52:37 -03:00
2023-04-17 09:01:14 +02:00
2023-05-22 10:16:30 -04:00
2023-04-15 02:36:15 +03:00
2023-04-13 17:16:03 +03:00
2023-02-25 09:55:04 +01:00
2023-02-09 13:25:39 +01:00
2023-04-07 14:19:45 +10:00
2023-04-11 10:51:25 +02:00