diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/TextureDownloadModule.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs | 15 |
2 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index 4e96572..6ebf47f 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Environment.Modules | |||
49 | 49 | ||
50 | private readonly BlockingQueue<TextureSender> m_queueSenders = new BlockingQueue<TextureSender>(); | 50 | private readonly BlockingQueue<TextureSender> m_queueSenders = new BlockingQueue<TextureSender>(); |
51 | 51 | ||
52 | private Dictionary<LLUUID, UserTextureDownloadService> m_userTextureServices = | 52 | private readonly Dictionary<LLUUID, UserTextureDownloadService> m_userTextureServices = |
53 | new Dictionary<LLUUID, UserTextureDownloadService>(); | 53 | new Dictionary<LLUUID, UserTextureDownloadService>(); |
54 | 54 | ||
55 | private Thread m_thread; | 55 | private Thread m_thread; |
@@ -73,6 +73,22 @@ namespace OpenSim.Region.Environment.Modules | |||
73 | m_scenes.Add(scene); | 73 | m_scenes.Add(scene); |
74 | m_scene = scene; | 74 | m_scene = scene; |
75 | m_scene.EventManager.OnNewClient += NewClient; | 75 | m_scene.EventManager.OnNewClient += NewClient; |
76 | m_scene.EventManager.OnRemovePresence += EventManager_OnRemovePresence; | ||
77 | } | ||
78 | } | ||
79 | |||
80 | private void EventManager_OnRemovePresence(LLUUID agentId) | ||
81 | { | ||
82 | UserTextureDownloadService textureService; | ||
83 | |||
84 | lock (m_userTextureServices) | ||
85 | { | ||
86 | if( m_userTextureServices.TryGetValue( agentId, out textureService )) | ||
87 | { | ||
88 | textureService.Close(); | ||
89 | |||
90 | m_userTextureServices.Remove(agentId); | ||
91 | } | ||
76 | } | 92 | } |
77 | } | 93 | } |
78 | 94 | ||
diff --git a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs index 9a5b362..5e768ee 100644 --- a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs | |||
@@ -94,5 +94,18 @@ namespace OpenSim.Region.Environment.Modules | |||
94 | m_sharedSendersQueue.Enqueue(textureSender); | 94 | m_sharedSendersQueue.Enqueue(textureSender); |
95 | } | 95 | } |
96 | } | 96 | } |
97 | |||
98 | internal void Close() | ||
99 | { | ||
100 | lock (m_textureSenders) | ||
101 | { | ||
102 | foreach( TextureSender textureSender in m_textureSenders.Values ) | ||
103 | { | ||
104 | textureSender.Cancel = true; | ||
105 | } | ||
106 | |||
107 | m_textureSenders.Clear(); | ||
108 | } | ||
109 | } | ||
97 | } | 110 | } |
98 | } \ No newline at end of file | 111 | } |