Reset the sound handle back to null after unloading

openmw-38
Chris Robinson 9 years ago
parent 4801661b34
commit fd7d58fe7e

@ -225,8 +225,11 @@ namespace MWSound
} }
SoundSet::iterator iter = mUnusedBuffers.begin(); SoundSet::iterator iter = mUnusedBuffers.begin();
Sound_Buffer *unused = &mSoundBuffers[*iter]; Sound_Buffer *unused = &mSoundBuffers[*iter];
mBufferCacheSize -= mOutput->getSoundDataSize(unused->mHandle); mBufferCacheSize -= mOutput->getSoundDataSize(unused->mHandle);
mOutput->unloadSound(unused->mHandle); mOutput->unloadSound(unused->mHandle);
unused->mHandle = 0;
mUnusedBuffers.erase(iter); mUnusedBuffers.erase(iter);
} }
mUnusedBuffers.insert(sfxid); mUnusedBuffers.insert(sfxid);

Loading…
Cancel
Save