From 9e6613d065182c8e9f0affb6a50f35f5981cb1db Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 20 Oct 2024 15:31:26 +0300 Subject: [PATCH] simplified destructor --- model.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/model.cpp b/model.cpp index 8d5f46a..0684ba1 100755 --- a/model.cpp +++ b/model.cpp @@ -28,18 +28,7 @@ namespace vb01{ } Model::~Model(){ - vector descendants; - getDescendants(descendants); - - for(Node *node : descendants) - for(Mesh *mesh : node->getMeshes()) - mesh->setMaterial(nullptr); - - while(!children.empty()){ - Node *c = children[children.size() - 1]; - dettachChild(c); - delete c; - } + this->setMaterial(nullptr); } void Model::update(){