Dispose() public method

Disposes a runtime
Once a runtime has been disposed, all resources owned by it are invalid and cannot be used. If the runtime is active (i.e. it is set to be current on a particular thread), it cannot be disposed.
public Dispose ( ) : void
return void
Example #1
0
        /// <summary>
        /// Destroys object
        /// </summary>
        /// <param name="disposing">Flag, allowing destruction of
        /// managed objects contained in fields of class</param>
        protected override void Dispose(bool disposing)
        {
            if (_disposedFlag.Set())
            {
                if (_dispatcher != null)
                {
                    _dispatcher.Invoke(() => _jsRuntime.Dispose());
                    _dispatcher.Dispose();
                }

                base.Dispose(disposing);
#if NETSTANDARD1_3
                if (disposing)
                {
                    if (_nativeFunctions != null)
                    {
                        _nativeFunctions.Clear();
                    }
                }
#endif
            }
        }