AudioEngine::end()调用异常

版本:“cocos2d-x-3.13”

调用AudioEngine::end()抛异常:

简单例子:

experimental::AudioEngine::play2d("booknextpage.mp3");
	
experimental::AudioEngine::stopAll();
experimental::AudioEngine::end();

线程函数

  void threadFunc()
    {
        while (true) {
            std::function<void()> task = nullptr;
            {
                std::unique_lock<std::mutex> lk(_queueMutex);
                if (_stop)
                {
                    break;
                }
                if (!_taskQueue.empty())
                {
                    task = std::move(_taskQueue.front());
                    _taskQueue.pop();
                }
                else
                {
                    **_taskCondition.wait(lk);**
                    continue;
                }
            }

            task();
        }
    }

是哪个平台?windows么?

对windows的,
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
if (_audioEngineImpl && s_threadPool == nullptr)
{
s_threadPool = new (std::nothrow) AudioEngineThreadPool(true);
}
把true改成false可以了

1赞