MCPcopy Create free account
hub / github.com/christophhart/HISE / removeAsync

Method removeAsync

hi_core/hi_core/GlobalAsyncModuleHandler.cpp:36–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36void MainController::GlobalAsyncModuleHandler::removeAsync(Processor* p, const SafeFunctionCall::Function& removeFunction)
37{
38 bool synchronous = p->getMainController()->isBeingDeleted() || p->getMainController()->isFlakyThreadingAllowed();
39
40 if (removeFunction)
41 {
42 auto f = [removeFunction](Processor* p)
43 {
44 LockHelpers::freeToGo(p->getMainController());
45
46 auto result = removeFunction(p);
47
48 p->getMainController()->getGlobalAsyncModuleHandler().addPendingUIJob(p, What::Delete);
49
50 return result;
51 };
52
53 if (synchronous)
54 f(p);
55 else
56 mc->getKillStateHandler().killVoicesAndCall(p, f, KillStateHandler::TargetThread::SampleLoadingThread);
57 }
58 else
59 {
60 p->getMainController()->getGlobalAsyncModuleHandler().addPendingUIJob(p, What::Delete);
61 }
62}
63
64void MainController::GlobalAsyncModuleHandler::addAsync(Processor* p, const SafeFunctionCall::Function& addFunction)
65{

Callers 5

removeModuleMethod · 0.80
setEffectMethod · 0.80
clearEffectFunction · 0.80
clearAsyncMethod · 0.80
deleteProcessorFromUIMethod · 0.80

Calls 5

isBeingDeletedMethod · 0.80
addPendingUIJobMethod · 0.80
getMainControllerMethod · 0.45
killVoicesAndCallMethod · 0.45

Tested by

no test coverage detected