Fix possible double dispose

pull/10366/head
Stepan Goremykin 12 months ago
parent 8ea812b65d
commit 2360d28cbb

@ -27,9 +27,9 @@ namespace Emby.Server.Implementations.Udp
private readonly byte[] _receiveBuffer = new byte[8192]; private readonly byte[] _receiveBuffer = new byte[8192];
private Socket _udpSocket; private readonly Socket _udpSocket;
private IPEndPoint _endpoint; private readonly IPEndPoint _endpoint;
private bool _disposed = false; private bool _disposed;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="UdpServer" /> class. /// Initializes a new instance of the <see cref="UdpServer" /> class.
@ -125,7 +125,8 @@ namespace Emby.Server.Implementations.Udp
return; return;
} }
_udpSocket?.Dispose(); _udpSocket.Dispose();
_disposed = true;
} }
} }
} }

Loading…
Cancel
Save