Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New object pointer cleanup #1645

Merged
merged 4 commits into from
Jun 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion Engine/source/core/stream/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void Stream::readLongString(U32 maxStringLen, char *stringBuf)
{
U32 len;
read(&len);
if(len > maxStringLen)
if(len >= maxStringLen)
{
m_streamStatus = IOError;
return;
Expand Down