From b7e51a38ef671aff02878c6dee74b88d4f477f70 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 19 Jan 2020 20:16:13 +0100 Subject: [PATCH] Update HL1MDLLoader.cpp Minor findings. --- code/MDL/HalfLife/HL1MDLLoader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/MDL/HalfLife/HL1MDLLoader.cpp b/code/MDL/HalfLife/HL1MDLLoader.cpp index ea156316f..edba58617 100644 --- a/code/MDL/HalfLife/HL1MDLLoader.cpp +++ b/code/MDL/HalfLife/HL1MDLLoader.cpp @@ -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();