Prevent segfault on shutdown

Oddly enough, putting the check in the Release function doesn't fix
it. Makes me wonder how DirectSound did it. I don't know much C++.
This commit is contained in:
Clownacy 2019-08-15 18:38:36 +00:00
parent cb4a9d40b9
commit c27d15dddc

View file

@ -263,7 +263,8 @@ void EndDirectSound()
EndOrganya();
for (unsigned int i = 0; i < SE_MAX; ++i)
lpSECONDARYBUFFER[i]->Release();
if (lpSECONDARYBUFFER[i])
lpSECONDARYBUFFER[i]->Release();
SDL_QuitSubSystem(SDL_INIT_AUDIO);