Address Issue #80 packetInbox/packetOutbox may already be destroyed before NetworkManager.Shutdown() is called. The very obvious fragility of the code is an issue, but we'll slap a bandaid on there.
This commit is contained in:
@@ -559,16 +559,16 @@ namespace OpenMetaverse
|
||||
return Connect(endPoint, handle, setDefault, seedcaps, sizeX, sizeY);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Connect to simulator assuming legacy region size
|
||||
/// </summary>
|
||||
/// <param name="endPoint"></param>
|
||||
/// <param name="handle"></param>
|
||||
/// <param name="setDefault"></param>
|
||||
/// <param name="seedcaps"></param>
|
||||
/// <returns></returns>
|
||||
public Simulator Connect(IPEndPoint endPoint, ulong handle, bool setDefault, Uri seedcaps) {
|
||||
return Connect(endPoint, handle, setDefault, seedcaps, Simulator.DefaultRegionSizeX, Simulator.DefaultRegionSizeY);
|
||||
/// <summary>
|
||||
/// Connect to simulator assuming legacy region size
|
||||
/// </summary>
|
||||
/// <param name="endPoint"></param>
|
||||
/// <param name="handle"></param>
|
||||
/// <param name="setDefault"></param>
|
||||
/// <param name="seedcaps"></param>
|
||||
/// <returns></returns>
|
||||
public Simulator Connect(IPEndPoint endPoint, ulong handle, bool setDefault, Uri seedcaps) {
|
||||
return Connect(endPoint, handle, setDefault, seedcaps, Simulator.DefaultRegionSizeX, Simulator.DefaultRegionSizeY);
|
||||
}
|
||||
/// <summary>
|
||||
/// Connect to a simulator
|
||||
@@ -892,10 +892,14 @@ namespace OpenMetaverse
|
||||
OnSimDisconnected(new SimDisconnectedEventArgs(CurrentSim, type));
|
||||
}
|
||||
}
|
||||
|
||||
_packetInbox.Writer.Complete();
|
||||
_packetOutbox.Writer.Complete();
|
||||
|
||||
try
|
||||
{
|
||||
_packetInbox.Writer.Complete();
|
||||
_packetOutbox.Writer.Complete();
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{ /* noop! */ }
|
||||
_packetInbox = null;
|
||||
_packetOutbox = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user