Exemple #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (isDisposed)
            {
                return;
            }
            isDisposed = true;

            if (executionState > ExecutionState.Stopping)
            {
                throw new InvalidOperationException($"{nameof(Exit)} must be called before the {nameof(GameHost)} is disposed.");
            }

            // Delay disposal until the game has exited
            while (executionState > ExecutionState.Stopped)
            {
                Thread.Sleep(10);
            }

            Root?.Dispose();

            config?.Dispose();
            debugConfig?.Dispose();

            Logger.Flush();
        }
Exemple #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (isDisposed)
            {
                return;
            }
            isDisposed = true;

            if (executionState > ExecutionState.Stopping)
            {
                throw new InvalidOperationException($"{nameof(Exit)} must be called before the {nameof(GameHost)} is disposed.");
            }

            // Delay disposal until the game has exited
            while (executionState > ExecutionState.Stopped)
            {
                Thread.Sleep(10);
            }

            AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;

            Root?.Dispose();
            Root = null;

            config?.Dispose();
            debugConfig?.Dispose();

            Window?.Dispose();

            toolkit?.Dispose();

            Logger.Flush();
        }
Exemple #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (isDisposed)
            {
                return;
            }

            isDisposed = true;
            stopAllThreads();
            Root?.Dispose();

            config?.Dispose();
            debugConfig?.Dispose();

            Logger.WaitForCompletion();
        }