cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.

Home Page:https://www.cocos.com/en/cocos2d-x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The main thread go into a dead loop when calling AudioPlayer::destroy()

zhouguoshan opened this issue · comments

  • cocos2d-x version:4.0
  • devices test on:
  • developing environments
    • NDK version:
    • Xcode version:
    • VS version:
    • browser type and version:

Steps to Reproduce:

  1. The main thread go into a dead loop when calling AudioPlayer::destroy()

while (bufferProcessed < QUEUEBUFFER_NUM) { std::this_thread::sleep_for(std::chrono::milliseconds(2)); alGetSourcei(_alSource, AL_BUFFERS_PROCESSED, &bufferProcessed); }

alGetSourcei always return 0, so it's a dead loop, then the game freezes.

this will occur in iOS 14 after answer phone!