/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> public virtual void Dispose() { if (!IsDisposed) { IsDisposed = true; OnDispose?.Invoke(this, EventArgs.Empty); ThreadFactory?.Dispose(); ModuleFactory?.Dispose(); MemoryFactory?.Dispose(); WindowFactory?.Dispose(); Handle?.Close(); GC.SuppressFinalize(this); } }