Calling .Close() on AutoResetEvent and ManualResetEvent (those classes contain an unmanaged resource that will not automatically be disposed when they are GCed), and commenting out some ManualResetEvents that are not in use yet
parent
a5b9971fd7
commit
494a1e922d
|
@ -146,6 +146,7 @@ namespace OpenSim.Framework.Communications
|
||||||
// If the operation isn't done, wait for it
|
// If the operation isn't done, wait for it
|
||||||
AsyncWaitHandle.WaitOne();
|
AsyncWaitHandle.WaitOne();
|
||||||
AsyncWaitHandle.Close();
|
AsyncWaitHandle.Close();
|
||||||
|
m_waitHandle.Close();
|
||||||
m_waitHandle = null; // Allow early GC
|
m_waitHandle = null; // Allow early GC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ namespace OpenSim.Framework.Communications
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This flag will help block the main synchroneous method, in case we run in synchroneous mode
|
/// This flag will help block the main synchroneous method, in case we run in synchroneous mode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ManualResetEvent _allDone = new ManualResetEvent(false);
|
//public static ManualResetEvent _allDone = new ManualResetEvent(false);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default time out period
|
/// Default time out period
|
||||||
|
@ -282,12 +282,12 @@ namespace OpenSim.Framework.Communications
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s.Close();
|
s.Close();
|
||||||
_allDone.Set();
|
//_allDone.Set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_allDone.Set();
|
//_allDone.Set();
|
||||||
_asyncException = e;
|
_asyncException = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
threadFinishEvent.WaitOne();
|
threadFinishEvent.WaitOne();
|
||||||
|
threadFinishEvent.Close();
|
||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
throw new Exception(exception.Message, exception);
|
throw new Exception(exception.Message, exception);
|
||||||
|
@ -148,6 +149,7 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
threadFinishEvent.WaitOne();
|
threadFinishEvent.WaitOne();
|
||||||
|
threadFinishEvent.Close();
|
||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
throw new Exception(exception.Message, exception);
|
throw new Exception(exception.Message, exception);
|
||||||
|
@ -199,6 +201,7 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
threadFinishEvent.WaitOne();
|
threadFinishEvent.WaitOne();
|
||||||
|
threadFinishEvent.Close();
|
||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
throw new Exception(exception.Message, exception);
|
throw new Exception(exception.Message, exception);
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace OpenSim
|
||||||
m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
|
m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
|
||||||
|
|
||||||
WorldHasComeToAnEnd.WaitOne();
|
WorldHasComeToAnEnd.WaitOne();
|
||||||
|
WorldHasComeToAnEnd.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||||
public string body;
|
public string body;
|
||||||
public int responseCode;
|
public int responseCode;
|
||||||
public string responseBody;
|
public string responseBody;
|
||||||
public ManualResetEvent ev;
|
//public ManualResetEvent ev;
|
||||||
public bool requestDone;
|
public bool requestDone;
|
||||||
public int startTime;
|
public int startTime;
|
||||||
public string uri;
|
public string uri;
|
||||||
|
@ -456,7 +456,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||||
requestData.headers["x-query-string"] = queryString;
|
requestData.headers["x-query-string"] = queryString;
|
||||||
requestData.headers["x-script-url"] = url.url;
|
requestData.headers["x-script-url"] = url.url;
|
||||||
|
|
||||||
requestData.ev = new ManualResetEvent(false);
|
//requestData.ev = new ManualResetEvent(false);
|
||||||
lock (url.requests)
|
lock (url.requests)
|
||||||
{
|
{
|
||||||
url.requests.Add(requestID, requestData);
|
url.requests.Add(requestID, requestData);
|
||||||
|
|
Loading…
Reference in New Issue