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,9 +5,11 @@
#include <cmath>
CImage::~CImage() {
if (imageTimer) {
imageTimer->cancel();
imageTimer.reset();
}
}
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
const auto PIMAGE = (CImage*)data;

View file

@ -6,9 +6,11 @@
#include "../../core/hyprlock.hpp"
CLabel::~CLabel() {
if (labelTimer) {
labelTimer->cancel();
labelTimer.reset();
}
}
static void onTimer(std::shared_ptr<CTimer> self, void* data) {
const auto PLABEL = (CLabel*)data;