| 385 | } |
| 386 | |
| 387 | void AudioCache::invokingLoadCallbacks() |
| 388 | { |
| 389 | if (*_isDestroyed) |
| 390 | { |
| 391 | AXLOGV("AudioCache ({}) was destroyed, don't invoke preload callback ...", fmt::ptr(this)); |
| 392 | return; |
| 393 | } |
| 394 | |
| 395 | auto isDestroyed = _isDestroyed; |
| 396 | auto scheduler = Director::getInstance()->getScheduler(); |
| 397 | scheduler->runOnAxmolThread([&, isDestroyed]() { |
| 398 | if (*isDestroyed) |
| 399 | { |
| 400 | AXLOGV("invokingLoadCallbacks perform in cocos thread, AudioCache ({}) was destroyed!", fmt::ptr(this)); |
| 401 | return; |
| 402 | } |
| 403 | |
| 404 | for (auto&& cb : _loadCallbacks) |
| 405 | { |
| 406 | cb(_state == State::READY); |
| 407 | } |
| 408 | |
| 409 | _loadCallbacks.clear(); |
| 410 | }); |
| 411 | } |
| 412 | } |
nothing calls this directly
no test coverage detected