Пример #1
0
        private void OnGameControllerTerminated(object sender, EventArgs args)
        {
            var gameController = sender as IGameController;

            if (gameController == null)
            {
                return;
            }
            gameController.Terminated -= OnGameControllerTerminated;
            Interlocked.CompareExchange(ref _gameController, null, gameController);
            _app.DoEvents();
            GC.Collect(2, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers();
            UpdateCommands();
        }