diff --git a/native/cocos/audio/win32/AudioEngine-win32.cpp b/native/cocos/audio/win32/AudioEngine-win32.cpp index c3d8b50b52..99422d35a8 100644 --- a/native/cocos/audio/win32/AudioEngine-win32.cpp +++ b/native/cocos/audio/win32/AudioEngine-win32.cpp @@ -360,6 +360,9 @@ void AudioEngineImpl::stop(int audioID) //Note: Don't set the flag to false here, it should be set in 'update' function. // Otherwise, the state got from alSourceState may be wrong // _alSourceUsed[player->_alSource] = false; + + // Call 'update' method to cleanup immediately since the schedule may be cancelled without any notification. + update(0.0f); } void AudioEngineImpl::stopAll() @@ -374,6 +377,9 @@ void AudioEngineImpl::stopAll() // { // _alSourceUsed[_alSources[index]] = false; // } + + // Call 'update' method to cleanup immediately since the schedule may be cancelled without any notification. + update(0.0f); } float AudioEngineImpl::getDuration(int audioID)