mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 05:19:48 +01:00
core: handle null timers in destructors (#350)
This commit is contained in:
parent
58c93d8de8
commit
768cd3ea52
2 changed files with 8 additions and 4 deletions
|
@ -5,8 +5,10 @@
|
|||
#include <cmath>
|
||||
|
||||
CImage::~CImage() {
|
||||
imageTimer->cancel();
|
||||
imageTimer.reset();
|
||||
if (imageTimer) {
|
||||
imageTimer->cancel();
|
||||
imageTimer.reset();
|
||||
}
|
||||
}
|
||||
|
||||
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
|
||||
|
|
|
@ -6,8 +6,10 @@
|
|||
#include "../../core/hyprlock.hpp"
|
||||
|
||||
CLabel::~CLabel() {
|
||||
labelTimer->cancel();
|
||||
labelTimer.reset();
|
||||
if (labelTimer) {
|
||||
labelTimer->cancel();
|
||||
labelTimer.reset();
|
||||
}
|
||||
}
|
||||
|
||||
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
|
||||
|
|
Loading…
Reference in a new issue