浏览代码

NULL out an object variable if it fails to register.

Jeff Hutchinson 4 年之前
父节点
当前提交
6d93e96dc3
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Engine/source/console/compiledEval.cpp

+ 1 - 0
Engine/source/console/compiledEval.cpp

@@ -1087,6 +1087,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa
                // This error is usually caused by failing to call Parent::initPersistFields in the class' initPersistFields().
                Con::warnf(ConsoleLogEntry::General, "%s: Register object failed for object %s of class %s.", getFileLine(ip - 2), currentNewObject->getName(), currentNewObject->getClassName());
                delete currentNewObject;
+               currentNewObject = NULL;
                ip = failJump;
                break;
             }