memory leak when preloadEffect

This commit is contained in:
GGGGamer 2013-04-24 12:10:18 +08:00
parent 84ec031fcf
commit a858613de1
1 changed files with 2 additions and 1 deletions

View File

@ -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);