fix(network): stack-use-after-return found by address sanitizer

Fixes compilation with clang.
This commit is contained in:
Aleksei Bavshin
2019-08-17 18:11:22 -07:00
parent 9d0842db48
commit 8f9e6c132d
2 changed files with 5 additions and 3 deletions

View File

@ -201,8 +201,9 @@ void waybar::modules::Network::worker() {
}
thread_timer_.sleep_for(interval_);
};
std::array<struct epoll_event, EPOLL_MAX> events{};
thread_ = [this, &events] {
thread_ = [this] {
std::array<struct epoll_event, EPOLL_MAX> events{};
int ec = epoll_wait(efd_, events.data(), EPOLL_MAX, -1);
if (ec > 0) {
for (auto i = 0; i < ec; i++) {