[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
parent 8c2a1a90f4
commit 6844da1d2c
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;