work around some 'tests' errors: dont use references to objects that may have been deleted

LSLKeyTest
UbitUmarov 2015-11-16 23:21:58 +00:00
parent 52a3cc39e9
commit 9c5646a1ba
1 changed files with 6 additions and 3 deletions

View File

@ -111,10 +111,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
SceneObjectGroup soSceneA = SceneHelpers.AddSceneObject(sceneA, 1, userId, "so1-", sceneObjectIdTail); SceneObjectGroup soSceneA = SceneHelpers.AddSceneObject(sceneA, 1, userId, "so1-", sceneObjectIdTail);
soSceneA.AbsolutePosition = new Vector3(128, 10, 20); soSceneA.AbsolutePosition = new Vector3(128, 10, 20);
string soSceneAName = soSceneA.Name;
string scriptItemSceneAName = "script1";
// CREATE SCRIPT TODO // CREATE SCRIPT TODO
InventoryItemBase scriptItemSceneA = new InventoryItemBase(); InventoryItemBase scriptItemSceneA = new InventoryItemBase();
// itemTemplate.ID = itemId; // itemTemplate.ID = itemId;
scriptItemSceneA.Name = "script1"; scriptItemSceneA.Name = scriptItemSceneAName;
scriptItemSceneA.Folder = soSceneA.UUID; scriptItemSceneA.Folder = soSceneA.UUID;
scriptItemSceneA.InvType = (int)InventoryType.LSL; scriptItemSceneA.InvType = (int)InventoryType.LSL;
@ -174,8 +177,8 @@ default
// TEST sending event to moved prim and output // TEST sending event to moved prim and output
{ {
SceneObjectGroup soSceneB = sceneB.GetSceneObjectGroup(soSceneA.Name); SceneObjectGroup soSceneB = sceneB.GetSceneObjectGroup(soSceneAName);
TaskInventoryItem scriptItemSceneB = soSceneB.RootPart.Inventory.GetInventoryItem(scriptItemSceneA.Name); TaskInventoryItem scriptItemSceneB = soSceneB.RootPart.Inventory.GetInventoryItem(scriptItemSceneAName);
// XXX: Should not be doing this so directly. Should call some variant of EventManager.touch() instead. // XXX: Should not be doing this so directly. Should call some variant of EventManager.touch() instead.
DetectParams[] det = new DetectParams[1]; DetectParams[] det = new DetectParams[1];