private void DisposeSelf() { if (!_Disposed) { _Disposed = true; _KCP.kcp_release(); _ConnectionHandle.Free(); //_Connection = null; // the connection should be disposed alreay, so we donot need to set it to null. // set handlers to null. _OnReceive = null; } }
internal void DestroySelf(bool inFinalizer) { if (!_Disposed) { _Disposed = true; if (_Ready) { _KCP.kcp_release(); } _InfoHandle.Free(); _Info = null; // set handlers to null. _OnReceive = null; _OnSendComplete = null; } if (!inFinalizer) { GC.SuppressFinalize(this); } }