Case 21494: Avoid mem leaked entities
Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -3773,9 +3773,12 @@ std::map<QString, QString> Application::prepareServerlessDomainContents(QUrl dom · 3772 unmodified lines | ||
| 3773 | 3773 | tmpTree->reaverageOctreeElements(); |
| 3774 | 3774 | tmpTree->sendEntities(&_entityEditSender, getEntities()->getTree(), 0, 0, 0); |
| 3775 | 3775 | } |
| 3776 | + std::map<QString, QString> namedPaths = tmpTree->getNamedPaths(); | |
| 3776 | 3777 | |
| 3777 | − return tmpTree->getNamedPaths(); | |
| 3778 | + // we must manually eraseAllOctreeElements(false) else the tmpTree will mem-leak | |
| 3779 | + tmpTree->eraseAllOctreeElements(false); | |
| 3778 | 3780 | |
| 3781 | + return namedPaths; | |
| 3779 | 3782 | } |
| 3780 | 3783 | |
| 3781 | 3784 | void Application::loadServerlessDomain(QUrl domainURL) { |