public void Dispose() { if (Pointer == IntPtr.Zero) { return; } try { StopServiceThread(); } catch { } if (Compressor != null) { Compressor.Dispose(); Compressor = null; } if (Checksum != null) { Checksum.Dispose(); Checksum = null; } if (Interceptor != null) { Interceptor.Dispose(); Interceptor = null; } m_Peers.ForEach(p => p.FreeHandle()); LibENet.HostDestroy(Pointer); Pointer = IntPtr.Zero; }