From b7d8d3448e32f8a3a3d51e6646c72866d6e49112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Tue, 20 Oct 2026 19:27:30 +0200 Subject: [PATCH] [Settings] Delete update channels at shutdown SettingsCache owns the stable and beta update channels as raw pointers, but they have no parent and are never deleted. Each owns a QNetworkAccessManager, so the test process leaves QtNetwork objects alive past QApplication teardown. Delete the channels in the SettingsCache destructor so their network managers are destroyed while the application object is still alive. --- cockatrice/src/client/settings/cache_settings.cpp | 7 +++++++ cockatrice/src/client/settings/cache_settings.h | 1 + 2 files changed, 8 insertions(+) diff --git a/cockatrice/src/client/settings/cache_settings.cpp b/cockatrice/src/client/settings/cache_settings.cpp index 08eccf1e4..fb66a6ebb 100644 --- a/cockatrice/src/client/settings/cache_settings.cpp +++ b/cockatrice/src/client/settings/cache_settings.cpp @@ -50,6 +50,13 @@ SettingsCache &SettingsCache::instance() return *settingsCache; // returns a QT managed singleton reference } +SettingsCache::~SettingsCache() +{ + for (ReleaseChannel *releaseChannel : releaseChannels) { + delete releaseChannel; + } +} + QString SettingsCache::getDataPath() { if (isPortableBuild) { diff --git a/cockatrice/src/client/settings/cache_settings.h b/cockatrice/src/client/settings/cache_settings.h index 5f699247d..472aac44f 100644 --- a/cockatrice/src/client/settings/cache_settings.h +++ b/cockatrice/src/client/settings/cache_settings.h @@ -99,6 +99,7 @@ private: public: SettingsCache(); + ~SettingsCache() override; QString getDataPath(); QString getSettingsPath(); [[nodiscard]] QString getCachePath() const;