diff options
author | Justin Clark-Casey (justincc) | 2015-01-16 22:44:54 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2015-01-16 22:46:48 +0000 |
commit | 8d724e90de0fb3b406f82f4e06b6f5b79c5a538c (patch) | |
tree | 069eac2d8fa46b63267d4119795a6cabf218c97f /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |
parent | minor: Suppress the log messages when user profiles data is requested for an ... (diff) | |
download | opensim-SC-8d724e90de0fb3b406f82f4e06b6f5b79c5a538c.zip opensim-SC-8d724e90de0fb3b406f82f4e06b6f5b79c5a538c.tar.gz opensim-SC-8d724e90de0fb3b406f82f4e06b6f5b79c5a538c.tar.bz2 opensim-SC-8d724e90de0fb3b406f82f4e06b6f5b79c5a538c.tar.xz |
For scripts in attachments, don't save .state files apart from the initial one as these are ignored since .state is saved in the attachment's asset.
This eliminates pointless work and exceptions when an appdomain is unloaded whilst an attachment script state is persisted.
Adds test for this case.
Relates to http://opensimulator.org/mantis/view.php?id=7407
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index f87d631..03fafed 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -718,7 +718,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
718 | // | 718 | // |
719 | try | 719 | try |
720 | { | 720 | { |
721 | instance.SaveState(); | 721 | if (instance.StatePersistedHere) |
722 | instance.SaveState(); | ||
722 | } | 723 | } |
723 | catch (Exception e) | 724 | catch (Exception e) |
724 | { | 725 | { |
@@ -830,7 +831,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
830 | lock (m_Scripts) | 831 | lock (m_Scripts) |
831 | { | 832 | { |
832 | foreach (IScriptInstance instance in m_Scripts.Values) | 833 | foreach (IScriptInstance instance in m_Scripts.Values) |
833 | instances.Add(instance); | 834 | { |
835 | if (instance.StatePersistedHere) | ||
836 | { | ||
837 | // m_log.DebugFormat( | ||
838 | // "[XEngine]: Adding script {0}.{1}, item UUID {2}, prim UUID {3} in {4} for state persistence", | ||
839 | // instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name); | ||
840 | |||
841 | instances.Add(instance); | ||
842 | } | ||
843 | } | ||
834 | } | 844 | } |
835 | 845 | ||
836 | foreach (IScriptInstance i in instances) | 846 | foreach (IScriptInstance i in instances) |
@@ -1457,7 +1467,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1457 | } | 1467 | } |
1458 | } | 1468 | } |
1459 | 1469 | ||
1460 | instance.RemoveState(); | 1470 | if (instance.StatePersistedHere) |
1471 | instance.RemoveState(); | ||
1472 | |||
1461 | instance.DestroyScriptInstance(); | 1473 | instance.DestroyScriptInstance(); |
1462 | 1474 | ||
1463 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 1475 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |