| 475 | } |
| 476 | |
| 477 | void Director::cleanup() { |
| 478 | if (!_unmanagedNodes.empty()) { |
| 479 | for (Node* node : _unmanagedNodes) { |
| 480 | node->cleanup(); |
| 481 | } |
| 482 | } |
| 483 | _unmanagedNodes.clear(); |
| 484 | if (!_waitingList.empty()) { |
| 485 | for (Node* node : _waitingList) { |
| 486 | if (node) { |
| 487 | node->cleanup(); |
| 488 | } |
| 489 | } |
| 490 | } |
| 491 | _waitingList.clear(); |
| 492 | if (_ui3D) { |
| 493 | _ui3D->removeAllChildren(); |
| 494 | _ui3D->onExit(); |
| 495 | _ui3D->cleanup(); |
| 496 | _ui3D = nullptr; |
| 497 | _ui3DCamera = nullptr; |
| 498 | } |
| 499 | if (_ui) { |
| 500 | _ui->removeAllChildren(); |
| 501 | _ui->onExit(); |
| 502 | _ui->cleanup(); |
| 503 | _ui = nullptr; |
| 504 | _uiCamera = nullptr; |
| 505 | } |
| 506 | if (_root) { |
| 507 | _root->removeAllChildren(); |
| 508 | _root->onExit(); |
| 509 | _root->cleanup(); |
| 510 | _root = nullptr; |
| 511 | _entry = nullptr; |
| 512 | } |
| 513 | if (_postNode) { |
| 514 | _postNode->removeAllChildren(); |
| 515 | _postNode->onExit(); |
| 516 | _postNode->cleanup(); |
| 517 | _postNode = nullptr; |
| 518 | } |
| 519 | Event::handlePostEvents(); |
| 520 | if (_nvgContext) { |
| 521 | nvgDelete(_nvgContext); |
| 522 | _nvgContext = nullptr; |
| 523 | } |
| 524 | _camStack->clear(); |
| 525 | } |
| 526 | |
| 527 | void Director::addUnManagedNode(Node* node) { |
| 528 | _unmanagedNodes.push_back(node); |
nothing calls this directly
no test coverage detected