/// <summary> /// Destroys object /// </summary> /// <param name="disposing">Flag, allowing destruction of /// managed objects contained in fields of class</param> private void Dispose(bool disposing) { if (_disposedFlag.Set()) { if (disposing) { if (_dispatcher != null) { _dispatcher.Invoke(DisposeUnmanagedResources); _dispatcher.Dispose(); _dispatcher = null; } if (_typeMapper != null) { _typeMapper.Dispose(); _typeMapper = null; } _promiseContinuationCallback = null; } else { DisposeUnmanagedResources(); } } }
/// <summary> /// Destroys object /// </summary> /// <param name="disposing">Flag, allowing destruction of /// managed objects contained in fields of class</param> private void Dispose(bool disposing) { if (_disposedFlag.Set()) { if (_dispatcher != null) { _dispatcher.Invoke(() => { _jsContext.Release(); _jsRuntime.Dispose(); }); _dispatcher.Dispose(); } if (disposing) { if (_externalObjects != null) { _externalObjects.Clear(); } if (_nativeFunctions != null) { _nativeFunctions.Clear(); } _externalObjectFinalizeCallback = null; } } }