mirror of https://github.com/axmolengine/axmol.git
memory leak when preloadEffect
This commit is contained in:
parent
84ec031fcf
commit
a858613de1
|
@ -74,7 +74,7 @@ void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sharedMusic().Open(_FullPath(pszFilePath).c_str(), _Hash(pszFilePath));
|
||||
sharedMusic().Play((bLoop) ? -1 : 1);
|
||||
}
|
||||
|
@ -161,6 +161,7 @@ void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
|||
|
||||
BREAK_IF(nRet == pPlayer->GetSoundID());
|
||||
|
||||
delete pPlayer;
|
||||
sharedList().erase(nRet);
|
||||
nRet = 0;
|
||||
} while (0);
|
||||
|
|
Loading…
Reference in New Issue