fix: cancel thread and fix window close

This commit is contained in:
Alex
2020-05-27 09:10:38 +02:00
parent 3b16946c25
commit 6e7f22ac3a
11 changed files with 47 additions and 94 deletions

View File

@ -5,7 +5,7 @@
namespace waybar::util {
class Rfkill {
public:;
public:
Rfkill(enum rfkill_type rfkill_type);
~Rfkill() = default;
void waitForEvent();
@ -13,7 +13,7 @@ class Rfkill {
private:
enum rfkill_type rfkill_type_;
int state_ = 0;
int state_ = 0;
};
} // namespace waybar::util

View File

@ -59,6 +59,11 @@ class SleeperThread {
do_run_ = false;
}
condvar_.notify_all();
auto handle = thread_.native_handle();
if (handle != 0) {
// TODO: find a proper way to terminate thread...
pthread_cancel(handle);
}
}
~SleeperThread() {