From 3d4d3427cd2c61b982b602eeba0ec7105ae9be50 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 6 Sep 2011 22:44:34 +0100 Subject: Comment out SceneViewer.Reset() and stop calling from Close() since this is useless work as a closed scene object is never reset. Strictly speaking, we could also stop bothering to clear the m_updateTimes and m_partsUpdateQueue if we are sure that the whole SceneViewer is shortly to be garbage collected anyway, but we'll leave them around for now. --- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 33 +++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index 3e0d1db..9ad80b8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -193,37 +193,38 @@ namespace OpenSim.Region.Framework.Scenes } } - public void Reset() - { - if (m_pendingObjects == null) - return; - - lock (m_pendingObjects) - { - if (m_pendingObjects != null) - { - m_pendingObjects.Clear(); - m_pendingObjects = null; - } - } - } +// public void Reset() +// { +// if (m_pendingObjects == null) +// return; +// +// lock (m_pendingObjects) +// { +// if (m_pendingObjects != null) +// { +// m_pendingObjects.Clear(); +// m_pendingObjects = null; +// } +// } +// } public void Close() { lock (m_pendingObjects) { + // We perform this under the m_pendingObjects lock in order to avoid a race condition with another + // thread on SendPrimUpdates() IsEnabled = false; lock (m_updateTimes) { m_updateTimes.Clear(); } + lock (m_partsUpdateQueue) { m_partsUpdateQueue.Clear(); } - - Reset(); } } -- cgit v1.1