Reset the sound handle back to null after unloading

This commit is contained in:
Chris Robinson 2015-11-24 18:48:25 -08:00
parent 4801661b34
commit fd7d58fe7e

View file

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