diff --git a/cocos/audio/AudioEngine.cpp b/cocos/audio/AudioEngine.cpp index cb81c9c8f0..c3b577df04 100644 --- a/cocos/audio/AudioEngine.cpp +++ b/cocos/audio/AudioEngine.cpp @@ -338,7 +338,7 @@ void AudioEngine::remove(AUDIO_ID audioID) if (it->second.profileHelper) { it->second.profileHelper->audioIDs.remove(audioID); } - _audioPathIDMap[*it->second.filePath].remove(audioID); + _audioPathIDMap[it->second.filePath].remove(audioID); _audioIDInfoMap.erase(audioID); } } diff --git a/cocos/audio/AudioEngineImpl.cpp b/cocos/audio/AudioEngineImpl.cpp index 808b4d91a7..eed6d5ee07 100644 --- a/cocos/audio/AudioEngineImpl.cpp +++ b/cocos/audio/AudioEngineImpl.cpp @@ -416,7 +416,7 @@ void AudioEngineImpl::update(float dt) std::string filePath; if (player->_finishCallbak) { auto& audioInfo = AudioEngine::_audioIDInfoMap[audioID]; - filePath = *audioInfo.filePath; + filePath = audioInfo.filePath; } AudioEngine::remove(audioID);