mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 07:36:16 +00:00
Changed: Delete SoundMngr to avoid memory leaks
This commit is contained in:
parent
c57fab9280
commit
46b72b622f
4 changed files with 7 additions and 5 deletions
|
@ -1555,7 +1555,8 @@ void postlogInit()
|
|||
{
|
||||
nlwarning("init : Error when creating 'SoundMngr' : %s", e.what());
|
||||
// leak the alocated sound manager...
|
||||
SoundMngr = 0;
|
||||
delete SoundMngr;
|
||||
SoundMngr = NULL;
|
||||
}
|
||||
|
||||
// Play Music just after the SoundMngr is inited
|
||||
|
|
|
@ -329,7 +329,8 @@ void updateFromClientCfg()
|
|||
catch(const Exception &e)
|
||||
{
|
||||
nlwarning("init : Error when creating 'SoundMngr' : %s", e.what());
|
||||
SoundMngr = 0;
|
||||
delete SoundMngr;
|
||||
SoundMngr = NULL;
|
||||
}
|
||||
|
||||
// re-init with good SFX/Music Volume
|
||||
|
|
|
@ -478,7 +478,7 @@ void releaseOutGame()
|
|||
if(SoundMngr)
|
||||
{
|
||||
delete SoundMngr;
|
||||
SoundMngr = 0;
|
||||
SoundMngr = NULL;
|
||||
}
|
||||
|
||||
// Delete the driver.
|
||||
|
@ -573,7 +573,7 @@ void release()
|
|||
if(SoundMngr)
|
||||
{
|
||||
delete SoundMngr;
|
||||
SoundMngr = 0;
|
||||
SoundMngr = NULL;
|
||||
}
|
||||
|
||||
// Release the Entities Animation Manager
|
||||
|
|
|
@ -2381,7 +2381,7 @@ void CUserEntity::updateSound(const TTime &time)
|
|||
H_AUTO_USE ( RZ_Client_Update_Sound );
|
||||
|
||||
// no sound manager, no need to update sound
|
||||
if (SoundMngr == 0)
|
||||
if (SoundMngr == NULL)
|
||||
return;
|
||||
|
||||
if (!(StereoHMD && true)) // TODO: ClientCfg.Headphone
|
||||
|
|
Loading…
Reference in a new issue