| 314 | return _viewNodeManager.getOrCreateViewNodeTreeForContext(context, ViewNodeTreeThreadAffinity::MAIN_THREAD); |
| 315 | } |
| 316 | |
| 317 | void Runtime::destroyContext(const SharedContext& context) { |
| 318 | // Destroying the context will release the Runtime ref. |
| 319 | // If the Context is the last one holding a reference on the Runtime, |
| 320 | // we want to make sure the Runtime will stay alive until |
| 321 | // this function is called. |
| 322 | auto strongRef = Valdi::strongRef(this); |
| 323 | |
| 324 | if (_mainThreadManager->currentThreadIsMainThread()) { |
| 325 | doDestroyContext(context); |
| 326 | } else { |
| 327 | _mainThreadManager->dispatch(context, [=]() { strongRef->doDestroyContext(context); }); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | void Runtime::doDestroyContext(const SharedContext& context) { |
nothing calls this directly
no test coverage detected