mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
Properly unload the backend sound buffers
This commit is contained in:
parent
0a8083e280
commit
60cc91e000
1 changed files with 5 additions and 6 deletions
|
@ -594,15 +594,14 @@ void S_CacheSound (sfxinfo_t *sfx)
|
|||
|
||||
void S_UnloadSound (sfxinfo_t *sfx)
|
||||
{
|
||||
if (sfx->data3d.isValid() && sfx->data != sfx->data3d)
|
||||
GSnd->UnloadSound(sfx->data3d);
|
||||
if (sfx->data.isValid())
|
||||
{
|
||||
if(sfx->data3d.isValid() && sfx->data != sfx->data3d)
|
||||
GSnd->UnloadSound(sfx->data3d);
|
||||
GSnd->UnloadSound(sfx->data);
|
||||
sfx->data.Clear();
|
||||
sfx->data3d.Clear();
|
||||
if (sfx->data.isValid() || sfx->data3d.isValid())
|
||||
DPrintf(DMSG_NOTIFY, "Unloaded sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]);
|
||||
}
|
||||
sfx->data.Clear();
|
||||
sfx->data3d.Clear();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue