From a69e751089d5d7c9189b64687560033cf14cda0c Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Mon, 30 Nov 2015 17:38:46 +0100 Subject: [PATCH] Revert "Fix windows builds" This reverts commit b085c09f86f9256c898fc0c629dab3f930ee9624. --- apps/openmw/mwsound/soundmanagerimp.cpp | 11 +++++------ apps/openmw/mwsound/soundmanagerimp.hpp | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index 71e1c97a8..0f5cee737 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -104,10 +104,9 @@ namespace MWSound SoundBufferList::iterator sfxiter = mSoundBuffers.begin(); for(;sfxiter != mSoundBuffers.end();++sfxiter) { - if((*sfxiter)->mHandle) - mOutput->unloadSound((*sfxiter)->mHandle); - (*sfxiter)->mHandle = 0; - delete (*sfxiter); + if(sfxiter->mHandle) + mOutput->unloadSound(sfxiter->mHandle); + sfxiter->mHandle = 0; } mUnusedBuffers.clear(); } @@ -146,8 +145,8 @@ namespace MWSound min = std::max(min, 1.0f); max = std::max(min, max); - Sound_Buffer *sfx = *mSoundBuffers.insert(mSoundBuffers.end(), - new Sound_Buffer("Sound/"+sound->mSound, volume, min, max) + Sound_Buffer *sfx = &*mSoundBuffers.insert(mSoundBuffers.end(), + Sound_Buffer("Sound/"+sound->mSound, volume, min, max) ); mVFS->normalizeFilename(sfx->mResourceName); diff --git a/apps/openmw/mwsound/soundmanagerimp.hpp b/apps/openmw/mwsound/soundmanagerimp.hpp index 196fb28f2..8e2df9f1a 100644 --- a/apps/openmw/mwsound/soundmanagerimp.hpp +++ b/apps/openmw/mwsound/soundmanagerimp.hpp @@ -56,7 +56,7 @@ namespace MWSound float mVoiceVolume; float mFootstepsVolume; - typedef std::deque SoundBufferList; + typedef std::deque SoundBufferList; // List of sound buffers, grown as needed. New enties are added to the // back, allowing existing Sound_Buffer references/pointers to remain // valid.