From baea4b793d1979ea4e426287ff9ea301a775afb9 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 10 Dec 2007 15:36:33 +0000 Subject: [PATCH] Changed how TextureDownloadModule is initialised, due to some weird behaviour from the module loaded which was resulting in a lot of unused TextureDownloadModule objects being created (and each starting up a thread). --- .../Environment/Modules/TextureDownloadModule.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index 702af192bf..5019de363b 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs @@ -54,19 +54,25 @@ namespace OpenSim.Region.Environment.Modules public TextureDownloadModule() { - m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); - m_thread.IsBackground = true; - m_thread.Start(); } public void Initialise(Scene scene, IConfigSource config) { + if (m_scene == null) + { + Console.WriteLine("Creating Texture download module"); + m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); + m_thread.IsBackground = true; + m_thread.Start(); + } + if (!m_scenes.Contains(scene)) { m_scenes.Add(scene); m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; } + } public void PostInitialise() @@ -272,7 +278,7 @@ namespace OpenSim.Region.Environment.Modules return false; } - public void SendPacket() + private void SendPacket() { if (PacketCounter <= NumPackets) {