diff options
author | Alexander Tkachev | 2016-07-20 15:00:44 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | b1264df120b6594a79d99cbb1cc5ef944fa2e448 (patch) | |
tree | 7e43653a86497135e18e494ecdb2d7dc92575afe /backends/cloud | |
parent | f743b319633dcd57ea08f5ac86d3daec548d1ab0 (diff) | |
download | scummvm-rg350-b1264df120b6594a79d99cbb1cc5ef944fa2e448.tar.gz scummvm-rg350-b1264df120b6594a79d99cbb1cc5ef944fa2e448.tar.bz2 scummvm-rg350-b1264df120b6594a79d99cbb1cc5ef944fa2e448.zip |
CLOUD: Check whether Storage is working when replacing it
We do that in CloudManager::replaceStorage(), but I've tried to
eliminate such possibility by adding a check in the StorageWizardDialog.
Diffstat (limited to 'backends/cloud')
-rw-r--r-- | backends/cloud/cloudmanager.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp index 8b7230fb5c..ed48ec5079 100644 --- a/backends/cloud/cloudmanager.cpp +++ b/backends/cloud/cloudmanager.cpp @@ -128,7 +128,14 @@ void CloudManager::replaceStorage(Storage *storage, uint32 index) { freeStorages(); if (!storage) error("CloudManager::replaceStorage: NULL storage passed"); if (index >= kStorageTotal) error("CloudManager::replaceStorage: invalid index passed"); - delete _activeStorage; + if (_activeStorage != nullptr && _activeStorage->isWorking()) { + warning("CloudManager::replaceStorage: replacing Storage while the other is working"); + if (_activeStorage->isDownloading()) _activeStorage->cancelDownload(); + if (_activeStorage->isSyncing()) _activeStorage->cancelSync(); + removeStorage(_activeStorage); + } else { + delete _activeStorage; + } _activeStorage = storage; _currentStorageIndex = index; save(); |