3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 20:55:24 +02:00

Merge pull request from SamGondelman/matCrash

Fix crash on shutdown in domain with material
This commit is contained in:
Sam Gondelman 2018-08-28 11:48:35 -07:00 committed by GitHub
commit 89bd24dd54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1841,6 +1841,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
});
EntityTree::setAddMaterialToEntityOperator([this](const QUuid& entityID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
if (_aboutToQuit) {
return false;
}
// try to find the renderable
auto renderable = getEntities()->renderableForEntityId(entityID);
if (renderable) {
@ -1856,6 +1860,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
return false;
});
EntityTree::setRemoveMaterialFromEntityOperator([this](const QUuid& entityID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
if (_aboutToQuit) {
return false;
}
// try to find the renderable
auto renderable = getEntities()->renderableForEntityId(entityID);
if (renderable) {