Merge pull request #594 from LuisAntonRebollo/unit-tests-without-crash

Increased stability Torque3D: unit-tests running without a crash.
This commit is contained in:
Daniel Buckmaster 2014-06-16 10:57:04 +10:00
commit feec36731e
18 changed files with 113 additions and 19 deletions

View file

@ -98,6 +98,9 @@ static S32 QSORT_CALLBACK compareEntries(const void* a,const void* b)
//-----------------------------------------------------------------------------
bool GuiInspectorDynamicGroup::inspectGroup()
{
if( !mParent )
return false;
// clear the first responder if it's set
mStack->clearFirstResponder();

View file

@ -455,7 +455,7 @@ void GuiInspectorField::setInspectorProfile()
{
GuiControlProfile *profile = NULL;
if( mInspector->getNumInspectObjects() > 1 )
if( mInspector && (mInspector->getNumInspectObjects() > 1) )
{
if( !hasSameValueInAllObjects() )
Sim::findObject( "GuiInspectorMultiFieldDifferentProfile", profile );

View file

@ -230,7 +230,7 @@ void GuiInspectorGroup::clearFields()
bool GuiInspectorGroup::inspectGroup()
{
// We can't inspect a group without a target!
if( !mParent->getNumInspectObjects() )
if( !mParent || !mParent->getNumInspectObjects() )
return false;
// to prevent crazy resizing, we'll just freeze our stack for a sec..

View file

@ -50,6 +50,12 @@ GuiInspectorVariableField::~GuiInspectorVariableField()
bool GuiInspectorVariableField::onAdd()
{
if( !mInspector )
{
Con::errorf("GuiInspectorVariableField::onAdd - Fail - No inspector");
return false;
}
setInspectorProfile();
// Hack: skip our immediate parent