Example #1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public override void Dispose()
        {
            if (PathEffect is not null)
            {
                PathEffect.Dispose();
            }

            if (_drawingContext is not null && GetClipRectangle(_drawingContext.MotionCanvas) != RectangleF.Empty)
            {
                _drawingContext.Canvas.Restore();
                _drawingContext = null;
            }

            base.Dispose();
        }
Example #2
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                if (_clipPath != null)
                {
                    _clipPath.Dispose();
                    _clipPath = null;
                }

                if (_strokePathEffect != null)
                {
                    _strokePathEffect.Dispose();
                    _strokePathEffect = null;
                }

                if (_gradientProvider != null)
                {
                    _gradientProvider.Dispose();
                    _gradientProvider = null;
                }

                if (_strokeGradientProvider != null)
                {
                    _strokeGradientProvider.Dispose();
                    _strokeGradientProvider = null;
                }

                _pathProvider = null;
            }

            DisposeBorder(disposing);

            base.Dispose(disposing);
        }
Example #3
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public override void Dispose()
        {
            if (FontFamily != null && skiaPaint != null)
            {
                skiaPaint.Typeface.Dispose();
            }
            if (PathEffect is not null)
            {
                PathEffect.Dispose();
            }
            if (ImageFilter is not null)
            {
                ImageFilter.Dispose();
            }

            if (_drawingContext is not null && GetClipRectangle(_drawingContext.MotionCanvas) != LvcRectangle.Empty)
            {
                _drawingContext.Canvas.Restore();
                _drawingContext = null;
            }

            base.Dispose();
        }