diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 452c443..1831c39 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1478,18 +1478,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1478 | // Do we even have it? | 1478 | // Do we even have it? |
1479 | if (!m_Scripts.ContainsKey(itemID)) | 1479 | if (!m_Scripts.ContainsKey(itemID)) |
1480 | { | 1480 | { |
1481 | // Do we even have it? | ||
1482 | if (!m_Scripts.ContainsKey(itemID)) | ||
1483 | return; | ||
1484 | |||
1485 | lockScriptsForRead(false); | 1481 | lockScriptsForRead(false); |
1486 | lockScriptsForWrite(true); | ||
1487 | m_Scripts.Remove(itemID); | ||
1488 | lockScriptsForWrite(false); | ||
1489 | |||
1490 | return; | 1482 | return; |
1491 | } | 1483 | } |
1492 | |||
1493 | 1484 | ||
1494 | IScriptInstance instance=m_Scripts[itemID]; | 1485 | IScriptInstance instance=m_Scripts[itemID]; |
1495 | lockScriptsForRead(false); | 1486 | lockScriptsForRead(false); |
@@ -1523,11 +1514,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1523 | instance.RemoveState(); | 1514 | instance.RemoveState(); |
1524 | instance.DestroyScriptInstance(); | 1515 | instance.DestroyScriptInstance(); |
1525 | 1516 | ||
1526 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 1517 | if (m_DomainScripts.ContainsKey(instance.AppDomain)) |
1527 | if (m_DomainScripts[instance.AppDomain].Count == 0) | ||
1528 | { | 1518 | { |
1529 | m_DomainScripts.Remove(instance.AppDomain); | 1519 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |
1530 | UnloadAppDomain(instance.AppDomain); | 1520 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
1521 | { | ||
1522 | m_DomainScripts.Remove(instance.AppDomain); | ||
1523 | UnloadAppDomain(instance.AppDomain); | ||
1524 | } | ||
1531 | } | 1525 | } |
1532 | 1526 | ||
1533 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; | 1527 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; |