mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-26 00:45:49 +00:00
Merge pull request #1792 from unknownbrackets/windows-ui
Fix crashes / bad errors when loading a file fails
This commit is contained in:
commit
4b9d6d26d3
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -97,7 +97,8 @@ void WindowsHost::UpdateSound()
|
||||
void WindowsHost::ShutdownSound()
|
||||
{
|
||||
DSound::DSound_StopSound();
|
||||
delete curMixer;
|
||||
if (curMixer != NULL)
|
||||
delete curMixer;
|
||||
curMixer = 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user