From 609372ad9a1659b6867686b765f6ffdfdf590a4e Mon Sep 17 00:00:00 2001 From: Collecting Date: Thu, 8 Jan 2026 07:08:40 +0000 Subject: [PATCH] fix(ui): Improper Overlay Shutdown & Zombie Processes Signed-off-by: Collecting --- src/citron/util/performance_overlay.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/citron/util/performance_overlay.cpp b/src/citron/util/performance_overlay.cpp index ff265f734..caa492283 100644 --- a/src/citron/util/performance_overlay.cpp +++ b/src/citron/util/performance_overlay.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include #include #include @@ -90,7 +91,9 @@ PerformanceOverlay::PerformanceOverlay(QWidget* parent) : QWidget(UISettings::Is UpdatePosition(); } -PerformanceOverlay::~PerformanceOverlay() = default; +PerformanceOverlay::~PerformanceOverlay() { + update_timer.stop(); +} void PerformanceOverlay::SetVisible(bool visible) { is_enabled = visible; @@ -167,7 +170,14 @@ void PerformanceOverlay::mouseReleaseEvent(QMouseEvent* event) { } void PerformanceOverlay::UpdatePerformanceStats() { - if (!main_window || !is_enabled) return; + // Stop the timer and hide if the app is closing + if (QCoreApplication::closingDown() || !main_window || main_window->isHidden()) { + update_timer.stop(); + if (!this->isHidden()) this->hide(); + return; + } + + if (!is_enabled) return; if (UISettings::IsGamescope()) { bool ui_active = (QApplication::activePopupWidget() != nullptr);