MCPcopy Create free account
hub / github.com/axmolengine/axmol / invokingLoadCallbacks

Method invokingLoadCallbacks

core/audio/AudioCache.cpp:387–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387void 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}

Callers

nothing calls this directly

Calls 4

getInstanceFunction · 0.85
runOnAxmolThreadMethod · 0.80
ptrFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected