浏览代码

Best to check the number of children before checking the actual array

RevoluPowered 5 年之前
父节点
当前提交
a30936954e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/Common/scene.cpp

+ 1 - 1
code/Common/scene.cpp

@@ -68,7 +68,7 @@ aiNode::aiNode(const std::string& name)
 aiNode::~aiNode() {
     // delete all children recursively
     // to make sure we won't crash if the data is invalid ...
-    if (mChildren && mNumChildren)
+    if (mNumChildren && mChildren)
     {
         for (unsigned int a = 0; a < mNumChildren; a++)
             delete mChildren[a];