From d79a3cc5e175369e5ddb931f87eb86b1155763ad Mon Sep 17 00:00:00 2001 From: Tleiades Hax Date: Fri, 19 Oct 2007 06:10:35 +0000 Subject: [PATCH] r 2113 introduced a leak, this should fix the leak --- OpenSim/Region/Environment/Scenes/Scene.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ab8a48a64f..a3857c6a84 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1065,6 +1065,14 @@ namespace OpenSim.Region.Environment.Scenes delegate void InformClientOfNeighbourDelegate(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint); + private void InformClientOfNeighbourCompleted(IAsyncResult iar) + { + InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState; + + + icon.EndInvoke(iar); + } + /// /// Async compnent for informing client of which neighbours exists /// @@ -1075,7 +1083,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void InformClientOfNeighbourAsync(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint) + private void InformClientOfNeighbourAsync(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint) { bool regionAccepted = commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, a); @@ -1100,7 +1108,9 @@ namespace OpenSim.Region.Environment.Scenes agent.child = true; InformClientOfNeighbourDelegate d = new InformClientOfNeighbourDelegate(InformClientOfNeighbourAsync); - IAsyncResult asyncInform = d.BeginInvoke(remoteClient, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, null, null); + IAsyncResult asyncInform = d.BeginInvoke(remoteClient, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, + new AsyncCallback(InformClientOfNeighbourCompleted), + null); //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort); } }