mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6201 from iSevenDays/patch-6
Fix potential memory leak in SimpleAudioEngine::preloadEffect
This commit is contained in:
commit
a2fcc79ad0
|
@ -462,7 +462,7 @@ void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
|||
{
|
||||
ALuint buffer = AL_NONE;
|
||||
ALuint source = AL_NONE;
|
||||
soundData *data = new soundData;
|
||||
|
||||
|
||||
checkALError("preloadEffect:init");
|
||||
OpenALFile file;
|
||||
|
@ -490,6 +490,7 @@ void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
|||
alSourcei(source, AL_BUFFER, buffer);
|
||||
checkALError("preloadEffect:alSourcei");
|
||||
|
||||
soundData *data = new soundData;
|
||||
data->isLooped = false;
|
||||
data->buffer = buffer;
|
||||
data->source = source;
|
||||
|
|
Loading…
Reference in New Issue