UserBox::~UserBox() { log(L_DEBUG, "~UserBox"); removeChilds(); if (pMain) pMain->destroyBox(this); log(L_DEBUG, "~UserBox OK"); }
/** recursively delete all childs of given node */ void EmotsWalker::removeChilds(PrefixNode *node) { foreach (const Prefix &ch, node->children) { removeChilds(ch.second); delete ch.second; } }
Node & Node::operator=(Node const & node) { Transformable::operator=(node); m_parent = node.m_parent; removeChilds(); for (auto & it : node.m_childs) addChild(it); setAnimation(node.m_animation); m_globalMatrix = node.m_globalMatrix; m_mesh.reset(new Mesh(*node.m_mesh)); return (*this); }
Node & Node::operator=(Node && node) { Transformable::operator=(std::move(node)); m_parent = node.m_parent; removeChilds(); std::move(node.m_childs.begin(), node.m_childs.end(), std::back_inserter(m_childs)); setAnimation(std::move(node.m_animation)); m_globalMatrix = std::move(node.m_globalMatrix); m_mesh = std::move(node.m_mesh); node.m_parent = nullptr; node.removeChilds(); node.m_animation = nullptr; return (*this); }
/** deletes entire dictionary of emots */ EmotsWalker::~EmotsWalker() { removeChilds(root); delete root; }
UserBox::~UserBox() { removeChilds(); if (pMain) pMain->destroyBox(this); }