# HG changeset patch # User rubidium # Date 2013-11-08 22:28:57 # Node ID 0cfca604a1aab93130fd99829a94f4328dab0fcd # Parent bfdf50e62a4a27945721932128d3c9112f3f8883 (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 diff --git a/src/newgrf_storage.h b/src/newgrf_storage.h --- a/src/newgrf_storage.h +++ b/src/newgrf_storage.h @@ -84,7 +84,7 @@ struct PersistentStorageArray : BaseStor 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(SIZE); memcpy(this->prev_storage, this->storage, sizeof(this->storage)); @@ -121,6 +121,7 @@ struct PersistentStorageArray : BaseStor memcpy(this->storage, this->prev_storage, sizeof(this->storage)); } free(this->prev_storage); + this->prev_storage = NULL; } };