mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[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:
parent
63a8f6b10b
commit
b7d8d3448e
2 changed files with 8 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ private:
|
|||
|
||||
public:
|
||||
SettingsCache();
|
||||
~SettingsCache() override;
|
||||
QString getDataPath();
|
||||
QString getSettingsPath();
|
||||
[[nodiscard]] QString getCachePath() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue