summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-24 17:02:59 +0000
committerrubidium <rubidium@openttd.org>2009-01-24 17:02:59 +0000
commit612975008e3369b7980050993a95ad0a44684c58 (patch)
tree3ac42b0bd92a4b2084727c16f9fd0fc978791865 /src
parentadb5eac77ecb6a7c465a60609c0d044eb90ed4c5 (diff)
downloadopenttd-612975008e3369b7980050993a95ad0a44684c58.tar.xz
(svn r15259) -Fix: [NewGRF] small memory leak when scanning labels
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 7618bd005..99774c397 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -6169,6 +6169,9 @@ void LoadNewGRF(uint load_index, uint file_index)
ClearTemporaryNewGRFData(_cur_grffile);
BuildCargoTranslationMap();
DEBUG(sprite, 2, "LoadNewGRF: Currently %i sprites are loaded", _cur_spriteid);
+ } else if (stage == GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) {
+ /* We're not going to activate this, so free whatever data we allocated */
+ ClearTemporaryNewGRFData(_cur_grffile);
}
}
}