예제 #1
0
        /// <inheritdoc/>
        protected override void CloseHandle()
        {
            this.EnsureCallingThread();

            // Protect the managed object from being collected by GC during closing inside the libuv logic
            if (!this._ClosingHandle.IsAllocated)
            {
                this._ClosingHandle = GCHandle.Alloc(this, GCHandleType.Normal);
            }

            // Object disposing will be performed inside a callback
            Libuv.uv_close(this, _UvCloseCallback);
        }