[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.
This commit is contained in:
Lukas Brübach 2026-10-20 19:27:30 +02:00 • committed by GitHub
parent 63a8f6b10b
commit b7d8d3448e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

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

View file

@ -99,6 +99,7 @@ private:
public:
SettingsCache();
~SettingsCache() override;
QString getDataPath();
QString getSettingsPath();
[[nodiscard]] QString getCachePath() const;