mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:40:05 +00:00
Add checks to prevent files being saved before being fully read.
This commit is contained in:
parent
f3c846f0b1
commit
bc79ed11a3
5 changed files with 31 additions and 1 deletions
|
|
@ -70,6 +70,8 @@ public:
|
|||
boost::unordered_flat_map<std::string, std::shared_ptr<PlacefileRecord>>
|
||||
placefileRecordMap_ {};
|
||||
std::shared_mutex placefileRecordLock_ {};
|
||||
|
||||
bool placefileSettingsRead_ {false};
|
||||
};
|
||||
|
||||
class PlacefileManager::Impl::PlacefileRecord
|
||||
|
|
@ -413,10 +415,15 @@ void PlacefileManager::Impl::ReadPlacefileSettings()
|
|||
}
|
||||
}
|
||||
}
|
||||
placefileSettingsRead_ = true;
|
||||
}
|
||||
|
||||
void PlacefileManager::Impl::WritePlacefileSettings()
|
||||
{
|
||||
if (!placefileSettingsRead_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
logger_->info("Saving placefile settings");
|
||||
|
||||
std::shared_lock lock {placefileRecordLock_};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue