Jelajahi Sumber

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

RevoluPowered 5 tahun lalu
induk
melakukan
a30936954e
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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];