diff options
-rw-r--r-- | sword2/sound.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sword2/sound.cpp b/sword2/sound.cpp index a84d7324e1..6ee3ef87b9 100644 --- a/sword2/sound.cpp +++ b/sword2/sound.cpp @@ -268,6 +268,13 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo return RDERR_INVALIDWAV; } + // The resource manager must have complete control over when resources + // are freed, or reference counting will break horribly. Besides, the + // data pointer is not valid for passing to free(). Why the hell is the + // AUTOFREE flag set by default anyway? + + flags &= ~Audio::Mixer::FLAG_AUTOFREE; + if (isReverseStereo()) flags |= Audio::Mixer::FLAG_REVERSE_STEREO; |