diff options
author | michi_cc <michi_cc@openttd.org> | 2012-02-04 22:14:21 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-02-04 22:14:21 +0000 |
commit | bd3c50791024b313208a4e163b7632554d8b5e9c (patch) | |
tree | 3b8a824506b25a867b2a0fc9275f4b70d5ea84c8 | |
parent | dd5d24c35a8806cdb9937cdb9e45a2ed2d093811 (diff) | |
download | openttd-bd3c50791024b313208a4e163b7632554d8b5e9c.tar.xz |
(svn r23896) -Fix (r23884): Don't free unallocated memory.
-rw-r--r-- | src/spritecache.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp index 83c6a15ae..75e402bed 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -885,7 +885,7 @@ void GfxClearSpriteCache() /* Clear sprite ptr for all cached items */ for (uint i = 0; i != _spritecache_items; i++) { SpriteCache *sc = GetSpriteCache(i); - if (sc->type != ST_RECOLOUR) DeleteEntryFromSpriteCache(i); + if (sc->type != ST_RECOLOUR && sc->ptr != NULL) DeleteEntryFromSpriteCache(i); } } |