Crashfix: Don't use gAgentAvatarp when it's not valid (anymore). Mostly resulted in crashes on exit.

Nicky 2012-07-11 22:50:17 +02:00
parent d674e4c680
commit e1a5cbf091
1 changed files with 19 additions and 0 deletions

View File

@ -350,6 +350,12 @@ void FSLSLBridge :: initBridge()
// Gets called by the Init, when inventory loaded.
void FSLSLBridge :: startCreation()
{
if( !isAgentAvatarValid() )
{
llwarns << "AgentAvatar is not valid" << llendl;
return;
}
llinfos << "startCreation called. gInventory.isInventoryUsable=" << gInventory.isInventoryUsable() << llendl;
//if bridge object doesn't exist - create and attach it, update script.
@ -708,6 +714,12 @@ void FSLSLBridgeRezCallback :: fire(const LLUUID& inv_item)
return;
}
if( gAgentAvatarp.isNull() )
{
llwarns << "Agent is 0, bailing out" << llendl;
return;
}
llinfos << "Bridge attach callback fired, looking for object..." << llendl;
LLViewerObject* obj = gAgentAvatarp->getWornAttachment(inv_item);
@ -756,6 +768,13 @@ void FSLSLBridgeScriptCallback::fire(const LLUUID& inv_item)
return;
}
if( gAgentAvatarp.isNull() )
{
llwarns << "Agent is 0, bailing out" << llendl;
return;
}
gInventory.updateItem(item);
gInventory.notifyObservers();