mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +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>
|
#include <cmath>
|
||||||
|
|
||||||
CImage::~CImage() {
|
CImage::~CImage() {
|
||||||
imageTimer->cancel();
|
if (imageTimer) {
|
||||||
imageTimer.reset();
|
imageTimer->cancel();
|
||||||
|
imageTimer.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
|
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
#include "../../core/hyprlock.hpp"
|
#include "../../core/hyprlock.hpp"
|
||||||
|
|
||||||
CLabel::~CLabel() {
|
CLabel::~CLabel() {
|
||||||
labelTimer->cancel();
|
if (labelTimer) {
|
||||||
labelTimer.reset();
|
labelTimer->cancel();
|
||||||
|
labelTimer.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
|
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
|
||||||
|
|
Loading…
Reference in a new issue