mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix: cancel thread and fix window close
This commit is contained in:
@ -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
|
||||
|
@ -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() {
|
||||
|
Reference in New Issue
Block a user