Mercurial > hg > openttd
changeset 7089:f657f07de0e6 draft
(svn r10356) -Fix (r10143): another memory leak eliminated.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 27 Jun 2007 16:54:50 +0000 |
parents | 2ee4ebcf0e11 |
children | b0933d2ad8e9 |
files | src/spritecache.cpp |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -283,6 +283,7 @@ 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 @@ 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;