don't try to release an sfx when the cache has been flushed: our held sfx gets ripped out from underneath us.

This commit is contained in:
Bill Currie 2007-03-24 08:37:04 +00:00 committed by Jeff Teunissen
parent e6c4817c92
commit 54139a1742

View file

@ -106,7 +106,10 @@ SND_CacheRelease (sfx_t *sfx)
{
sfxblock_t *block = (sfxblock_t *) sfx->data;
block->buffer = 0;
Cache_Release (&block->cache);
// due to the possibly asynchronous nature of the mixer, the cache
// may have been flushed behind our backs
if (block->cache.data)
Cache_Release (&block->cache);
}
sfxbuffer_t *