summaryrefslogtreecommitdiff
path: root/src/newgrf_storage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_storage.cpp')
-rw-r--r--src/newgrf_storage.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/newgrf_storage.cpp b/src/newgrf_storage.cpp
index 27a806ab1..c1c736e20 100644
--- a/src/newgrf_storage.cpp
+++ b/src/newgrf_storage.cpp
@@ -17,6 +17,14 @@
static std::set<BaseStorageArray*> _changed_storage_arrays;
/**
+ * Remove references to use.
+ */
+BaseStorageArray::~BaseStorageArray()
+{
+ _changed_storage_arrays.erase(this);
+}
+
+/**
* Add the changed storage array to the list of changed arrays.
* This is done so we only have to revert/save the changed
* arrays, which saves quite a few clears, etc. after callbacks.