ソースを参照

Fix memory leak in case of an error.

Kim Kulling 8 年 前
コミット
c9ada44ab5
1 ファイル変更2 行追加0 行削除
  1. 2 0
      code/ObjFileParser.cpp

+ 2 - 0
code/ObjFileParser.cpp

@@ -477,6 +477,8 @@ void ObjFileParser::getFace( aiPrimitiveType type ) {
                 }
             } else {
                 //On error, std::atoi will return 0 which is not a valid value
+                delete m_pModel;
+                m_pModel = nullptr;
                 throw DeadlyImportError("OBJ: Invalid face indice");
             }