Skip to content

Commit

Permalink
Merge pull request #1645 from Areloch/NewObjectPointerCleanup
Browse files Browse the repository at this point in the history
New object pointer cleanup
  • Loading branch information
Areloch authored Jun 21, 2016
2 parents b7882e7 + 810ac82 commit 68d44c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Engine/source/console/compiledEval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ ConsoleValueRef CodeBlock::exec(U32 ip, const char *functionName, Namespace *thi
{
Con::errorf(ConsoleLogEntry::General, "%s: Unable to instantiate non-SimObject class %s.", getFileLine(ip), (const char*)callArgv[1]);
delete object;
currentNewObject = NULL;
ip = failJump;
break;
}
Expand Down Expand Up @@ -902,6 +903,7 @@ ConsoleValueRef CodeBlock::exec(U32 ip, const char *functionName, Namespace *thi

// Fail to create the object.
delete object;
currentNewObject = NULL;
ip = failJump;
break;
}
Expand Down Expand Up @@ -1016,6 +1018,7 @@ ConsoleValueRef CodeBlock::exec(U32 ip, const char *functionName, Namespace *thi
Con::errorf(ConsoleLogEntry::General, "%s: preload failed for %s: %s.", getFileLine(ip),
currentNewObject->getName(), errorStr.c_str());
dataBlock->deleteObject();
currentNewObject = NULL;
ip = failJump;

// Prevent stack value corruption
Expand Down

0 comments on commit 68d44c4

Please sign in to comment.