mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r25956) -Fix [FS#5772]: temporary persistent storage modifications, e.g. command tests or those from GUI, were not properly reset, creating the possibility of desyncs
This commit is contained in:
parent
169bf3a403
commit
c04d635ddb
@ -84,7 +84,7 @@ struct PersistentStorageArray : BaseStorageArray {
|
||||
if (this->storage[pos] == value) return;
|
||||
|
||||
/* We do not have made a backup; lets do so */
|
||||
if (this->prev_storage != NULL) {
|
||||
if (this->prev_storage == NULL) {
|
||||
this->prev_storage = MallocT<TYPE>(SIZE);
|
||||
memcpy(this->prev_storage, this->storage, sizeof(this->storage));
|
||||
|
||||
@ -121,6 +121,7 @@ struct PersistentStorageArray : BaseStorageArray {
|
||||
memcpy(this->storage, this->prev_storage, sizeof(this->storage));
|
||||
}
|
||||
free(this->prev_storage);
|
||||
this->prev_storage = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user