Fix a nullref issue in the AgentSetAppearance packet handler when removing the physactor from the scene

avinationmerge
meta7 2010-08-10 09:55:40 -07:00
parent 48c52d6e48
commit 1582e05ac7
1 changed files with 11 additions and 6 deletions

View File

@ -1090,12 +1090,17 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (PhysicsActor != null) if (PhysicsActor != null)
{ {
m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; try
m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; {
m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
m_physicsActor.UnSubscribeEvents(); m_physicsActor.OnOutOfBounds -= OutOfBoundsCall;
m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
PhysicsActor = null; m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
m_physicsActor.UnSubscribeEvents();
PhysicsActor = null;
}
catch
{ }
} }
} }