Fix use-after-delete errors

This commit is contained in:
Ben Payne 2014-11-11 15:14:47 -05:00
parent d97d44f66f
commit c50c88d071
2 changed files with 3 additions and 4 deletions

View file

@ -3339,6 +3339,6 @@ void ShapeBase::ejectShellCasing( U32 imageSlot )
if (!casing->registerObject()) if (!casing->registerObject())
delete casing; delete casing;
else
casing->init( shellPos, shellVel ); casing->init( shellPos, shellVel );
} }

View file

@ -128,8 +128,7 @@ static void processNodeLights(AppNode* appNode, const MatrixF& offset, SimGroup*
Con::errorf(ConsoleLogEntry::General, "Failed to register light for \"%s\"", lightName.c_str()); Con::errorf(ConsoleLogEntry::General, "Failed to register light for \"%s\"", lightName.c_str());
delete pLight; delete pLight;
} }
else if (group)
if (group)
group->addObject(pLight); group->addObject(pLight);
} }