core: handle null timers in destructors (#350)

This commit is contained in:
André Silva 2024-05-26 18:46:53 +02:00 committed by GitHub
parent 58c93d8de8
commit 768cd3ea52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -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) {

View file

@ -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) {