summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-27 16:54:50 +0000
committerrubidium <rubidium@openttd.org>2007-06-27 16:54:50 +0000
commit43a85ee94fc2d8459161ccd0d1e8108e4c3888b9 (patch)
tree203e188941b03ddb204e84ef9a769f1dc7c70328
parent4f73e2a0307227c7f33af889e646df8368649219 (diff)
downloadopenttd-43a85ee94fc2d8459161ccd0d1e8108e4c3888b9.tar.xz
(svn r10356) -Fix (r10143): another memory leak eliminated.
-rw-r--r--src/spritecache.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index 4b46b224b..710bca443 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -283,6 +283,7 @@ void DupSprite(SpriteID old_spr, SpriteID new_spr)
scnew->file_pos = scold->file_pos;
scnew->ptr = NULL;
scnew->id = scold->id;
+ free((char *)scnew->grf_name);
scnew->grf_name = strdup(scold->grf_name);
}
@@ -493,6 +494,7 @@ void GfxInitSpriteMem()
NextBlock(_spritecache_ptr)->size = 0;
/* Reset the spritecache 'pool' */
+ for (uint i = 0; i < _spritecache_items; i++) free((char *)_spritecache[i].grf_name);
free(_spritecache);
_spritecache_items = 0;
_spritecache = NULL;