diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index b0fa68d1cc..8b961ed706 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -124,6 +124,7 @@ bool LoadFile(const char *filename, std::string *error_string) case FILETYPE_UNKNOWN: default: ERROR_LOG(LOADER, "Failed to identify file"); + *error_string = "Failed to identify file"; break; } return false; diff --git a/Windows/DSoundStream.cpp b/Windows/DSoundStream.cpp index 505311fdbb..88d2426c6f 100644 --- a/Windows/DSoundStream.cpp +++ b/Windows/DSoundStream.cpp @@ -14,8 +14,8 @@ namespace DSound StreamCallback callback; - IDirectSound8 *ds; - IDirectSoundBuffer *dsBuffer; + IDirectSound8 *ds = NULL; + IDirectSoundBuffer *dsBuffer = NULL; int bufferSize; // bytes int totalRenderedBytes; @@ -196,8 +196,10 @@ namespace DSound /* while (threadData!=2) ;*/ - dsBuffer->Release(); - ds->Release(); + if (dsBuffer != NULL) + dsBuffer->Release(); + if (ds != NULL) + ds->Release(); CloseHandle(soundSyncEvent); } diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 73d4387cb5..b5881ebdd6 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -97,7 +97,8 @@ void WindowsHost::UpdateSound() void WindowsHost::ShutdownSound() { DSound::DSound_StopSound(); - delete curMixer; + if (curMixer != NULL) + delete curMixer; curMixer = 0; }