aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/GcNotify.cs
diff options
context:
space:
mode:
authorMelanie2012-03-22 20:38:49 +0000
committerMelanie2012-03-22 20:38:49 +0000
commit33818994810130117bae62ba2123bf8b55f181ea (patch)
treeeeb54ef00919abbd1a86b08a659570512856ac42 /OpenSim/Framework/GcNotify.cs
parentRevert "Stop messing order of updates, destroing the defined order of the sel... (diff)
parentRework Diva's patch to simplify it (diff)
downloadopensim-SC-33818994810130117bae62ba2123bf8b55f181ea.zip
opensim-SC-33818994810130117bae62ba2123bf8b55f181ea.tar.gz
opensim-SC-33818994810130117bae62ba2123bf8b55f181ea.tar.bz2
opensim-SC-33818994810130117bae62ba2123bf8b55f181ea.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/World/Land/LandObject.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/GcNotify.cs (renamed from OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs)57
1 files changed, 28 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs b/OpenSim/Framework/GcNotify.cs
index 659c3a5..14a22a6 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs
+++ b/OpenSim/Framework/GcNotify.cs
@@ -25,39 +25,38 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Collections.Generic; 28using System;
29using System.Xml; 29using System.Reflection;
30using OpenMetaverse; 30using log4net;
31 31
32namespace OpenSim.Region.Framework.Scenes.Animation 32public class GcNotify
33{ 33{
34 public class AvatarAnimations 34 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
35
36 public static bool Enabled
35 { 37 {
36 public Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>(); 38 get { return s_initialized; }
37 public Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>(); 39 set
38 public Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>(); 40 {
41 if (!s_initialized && value)
42 new GcNotify();
43
44 s_initialized = value;
45 }
46 }
39 47
40 public AvatarAnimations() 48 private static bool s_initialized = false;
49
50 private GcNotify() {}
51
52 ~GcNotify()
53 {
54 if (!Environment.HasShutdownStarted && !AppDomain.CurrentDomain.IsFinalizingForUnload())
41 { 55 {
42 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) 56 m_log.DebugFormat("[GC NOTIFY]: Garbage collection triggered.");
43 { 57
44 XmlDocument doc = new XmlDocument(); 58 if (Enabled)
45 doc.Load(reader); 59 new GcNotify();
46 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
47 {
48 if (nod.Attributes["name"] != null)
49 {
50 string name = (string)nod.Attributes["name"].Value;
51 UUID id = (UUID)nod.InnerText;
52 string animState = (string)nod.Attributes["state"].Value;
53
54 AnimsUUID.Add(name, id);
55 AnimsNames.Add(id, name);
56 if (animState != "")
57 AnimStateNames.Add(id, animState);
58 }
59 }
60 }
61 } 60 }
62 } 61 }
63} 62} \ No newline at end of file