Exemplo n.º 1
0
        /// <summary>
        /// Unload content and cleanup unmanaged resources.
        /// </summary>
        public override void UnloadContent()
        {
            base.UnloadContent();

            if (_state != null && !_state.IsDisposed)
            {
                _state.Dispose();
                _state = null;
            }
            if (_font != null)
            {
                _font.Dispose();
            }
            _font = null;
            if (_target != null)
            {
                _target.Dispose();
            }
            _target = null;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Unload content and cleanup unmanaged resources.
        /// </summary>
        public override void UnloadContent()
        {
            base.UnloadContent();
            brushes.Cleanup();
            brushes = null;

            var regionProxies = regions.Values.ToList();

            regions.Clear();

            foreach (var r in regionProxies)
            {
                if (!r.IsDisposed)
                {
                    r.Dispose();
                }
            }

            if (state != null && !state.IsDisposed)
            {
                state.Dispose();
                state = null;
            }
        }