mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r10356) -Fix (r10143): another memory leak eliminated.
This commit is contained in:
parent
45ae73e03f
commit
ffffde515f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user