Adds some pointer cleanup in the event we bail out of creating a new object for whatever reason.

This commit is contained in:
Areloch 2016-06-11 02:06:24 -05:00
parent 0b178ec579
commit 3cfc6f787c

View file

@ -902,6 +902,7 @@ breakContinue:
// Fail to create the object.
delete object;
currentNewObject = NULL;
ip = failJump;
break;
}
@ -1016,6 +1017,7 @@ breakContinue:
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