mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 08:31:45 +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)
|
void S_UnloadSound (sfxinfo_t *sfx)
|
||||||
{
|
{
|
||||||
|
if (sfx->data3d.isValid() && sfx->data != sfx->data3d)
|
||||||
|
GSnd->UnloadSound(sfx->data3d);
|
||||||
if (sfx->data.isValid())
|
if (sfx->data.isValid())
|
||||||
{
|
|
||||||
if(sfx->data3d.isValid() && sfx->data != sfx->data3d)
|
|
||||||
GSnd->UnloadSound(sfx->data3d);
|
|
||||||
GSnd->UnloadSound(sfx->data);
|
GSnd->UnloadSound(sfx->data);
|
||||||
sfx->data.Clear();
|
if (sfx->data.isValid() || sfx->data3d.isValid())
|
||||||
sfx->data3d.Clear();
|
|
||||||
DPrintf(DMSG_NOTIFY, "Unloaded sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]);
|
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