Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _contentManager?.Dispose();
                _renderer?.Dispose();
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Dispose.
        /// </summary>
        /// <param name="disposing"> true for user code; false otherwise. </param>
        private void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                OnDispose(disposing);
                if (disposing)
                {
                    lock (_drawableComponent)
                    {
                        _drawableComponent.Clear();
                        _currentlyDrawableComponent.Clear();
                    }
                    lock (_updateableComponent)
                    {
                        _updateableComponent.Clear();
                        _currentlyUpdateableComponent.Clear();
                    }
                    lock (_contentableComponent)
                    {
                        _contentableComponent.Clear();
                        _currentlyContentableComponent.Clear();
                    }

                    _gameComponents.Clear();
                    _pendingInitializables.Clear();

                    _platform.Dispose();

                    _contentManager.Dispose();
                    _graphicsDevice.Dispose();
                }
                _collector.DisposeAndClear(disposing);

                _disposed = true;
            }
        }
Ejemplo n.º 3
0
 public void Dispose()
 {
     _contentManager.Dispose();
 }