Update HL1MDLLoader.cpp

Minor findings.
pull/2928/head
Kim Kulling 2020-01-19 20:16:13 +01:00 committed by GitHub
parent 9deb8fb786
commit b7e51a38ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -125,12 +125,14 @@ void HL1MDLLoader::release_resources() {
anim_headers_ = nullptr;
}
if (rootnode_children_.size()) {
// Root has some children ndoes. so let's proceed them
if (!rootnode_children_.empty()) {
// Here, it means that the nodes were not added to the
// scene root node. We still have to delete them.
for (auto it = rootnode_children_.begin(); it != rootnode_children_.end(); ++it) {
if (*it)
if (*it) {
delete *it;
}
}
// Ensure this happens only once.
rootnode_children_.clear();