private void Window_Closing(object sender, CancelEventArgs e) { DialogResult = true; if (_gamepad == null) { return; } _gamepad.CancelPollAsync(); _gamepad.Dispose(); }
private void wndFullScreen_Closing(object sender, CancelEventArgs e) { DialogResult = true; if (gamePad != null) { gamePad.CancelPollAsync(); gamePad.Dispose(); } _timer.Stop(); _timer = null; GC.Collect(); }