protected virtual void VisualizeWindow_OnClosing(object sender, CancelEventArgs e) { _persistentGameMain?.Dispose(); _persistentGameMain = null; GameMain?.Dispose(); GameMain = null; AiLoggers[0]?.Dispose(); AiLoggers[1]?.Dispose(); GameLogger?.Dispose(); if (_isForceClosing) { return; } e.Cancel = true; Hide(); }