mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
also Unload Sound
This commit is contained in:
parent
7b3aba8fdc
commit
7486ee867e
|
@ -348,6 +348,12 @@ int CSound::Update()
|
||||||
|
|
||||||
int CSound::Shutdown()
|
int CSound::Shutdown()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
for(unsigned SampleID = 0; SampleID < NUM_SAMPLES; SampleID++)
|
||||||
|
{
|
||||||
|
UnloadSample(SampleID);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_CloseAudio();
|
SDL_CloseAudio();
|
||||||
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
||||||
lock_destroy(m_SoundLock);
|
lock_destroy(m_SoundLock);
|
||||||
|
@ -684,7 +690,8 @@ void CSound::UnloadSample(int SampleID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Stop(SampleID);
|
Stop(SampleID);
|
||||||
mem_free(m_aSamples[SampleID].m_pData);
|
if (m_aSamples[SampleID].m_pData != 0x0)
|
||||||
|
mem_free(m_aSamples[SampleID].m_pData);
|
||||||
|
|
||||||
m_aSamples[SampleID].m_pData = 0x0;
|
m_aSamples[SampleID].m_pData = 0x0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue