mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
mem_free is safe on null pointers
This commit is contained in:
parent
6655b35bdd
commit
04e2946efc
|
@ -108,9 +108,7 @@ void *mem_alloc_debug(const char *filename, int line, unsigned size, unsigned al
|
|||
Frees a block allocated through <mem_alloc>.
|
||||
|
||||
Remarks:
|
||||
- In the debug version of the library the function will assert if
|
||||
a non-valid block is passed, like a null pointer or a block that
|
||||
isn't allocated.
|
||||
- Is safe on null pointers.
|
||||
|
||||
See Also:
|
||||
<mem_alloc>
|
||||
|
|
|
@ -357,11 +357,8 @@ int CSound::Shutdown()
|
|||
SDL_CloseAudio();
|
||||
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
||||
lock_destroy(m_SoundLock);
|
||||
if(m_pMixBuffer)
|
||||
{
|
||||
mem_free(m_pMixBuffer);
|
||||
m_pMixBuffer = 0;
|
||||
}
|
||||
mem_free(m_pMixBuffer);
|
||||
m_pMixBuffer = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -690,8 +687,7 @@ void CSound::UnloadSample(int SampleID)
|
|||
return;
|
||||
|
||||
Stop(SampleID);
|
||||
if (m_aSamples[SampleID].m_pData != 0x0)
|
||||
mem_free(m_aSamples[SampleID].m_pData);
|
||||
mem_free(m_aSamples[SampleID].m_pData);
|
||||
|
||||
m_aSamples[SampleID].m_pData = 0x0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue