a few more changes on potencial mem issues

melanie
UbitUmarov 2016-11-18 00:12:09 +00:00
parent e21ac8b3c4
commit ba7904a3a8
4 changed files with 19 additions and 2 deletions

View File

@ -141,6 +141,11 @@ namespace OpenSim.Framework.Capabilities
m_capsActive.Reset(); m_capsActive.Reset();
} }
~Caps()
{
m_capsActive.Dispose();
}
/// <summary> /// <summary>
/// Register a handler. This allows modules to register handlers. /// Register a handler. This allows modules to register handlers.
/// </summary> /// </summary>

View File

@ -55,6 +55,11 @@ namespace OpenSim.Framework
Dictionary2 = new Dictionary<TKey2, TValue>(capacity); Dictionary2 = new Dictionary<TKey2, TValue>(capacity);
} }
~DoubleDictionaryThreadAbortSafe()
{
rwLock.Dispose();
}
public void Add(TKey1 key1, TKey2 key2, TValue value) public void Add(TKey1 key1, TKey2 key2, TValue value)
{ {
bool gotLock = false; bool gotLock = false;

View File

@ -1483,6 +1483,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
lock (diskLock) lock (diskLock)
{ {
Stream stream = null;
try try
{ {
if (!Directory.Exists(dir)) if (!Directory.Exists(dir))
@ -1490,7 +1491,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
Directory.CreateDirectory(dir); Directory.CreateDirectory(dir);
} }
using(Stream stream = File.Open(filename, FileMode.Create)) stream = File.Open(filename, FileMode.Create);
ok = mesh.ToStream(stream); ok = mesh.ToStream(stream);
} }
catch (IOException e) catch (IOException e)
@ -1500,6 +1501,11 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
filename, e.Message, e.StackTrace); filename, e.Message, e.StackTrace);
ok = false; ok = false;
} }
finally
{
if(stream != null)
stream.Dispose();
}
if (!ok && File.Exists(filename)) if (!ok && File.Exists(filename))
{ {

View File

@ -625,6 +625,7 @@ namespace Amib.Threading.Internal
if (!_isDisposed) if (!_isDisposed)
{ {
Cleanup(); Cleanup();
_headWaiterEntry.Close();
} }
_isDisposed = true; _isDisposed = true;
} }