Example #1
0
    /// <summary>
    /// Releases the unmanaged resources used by the <see cref="Control"/> and its child controls
    /// and optionally releases the managed resources.
    /// </summary>
    /// <param name="disposing">
    /// true to release both managed and unmanaged resources; false to release only unmanaged
    /// resources.
    /// </param>
    protected override void Dispose(bool disposing)
    {
      if (!IsDisposed)
      {
        if (disposing)
        {

          _renderTarget.SafeDispose();

        }
      }

      base.Dispose(disposing);
    }
Example #2
0
        /// <summary>
        /// Releases the unmanaged resources used by the <see cref="Control"/> and its child controls
        /// and optionally releases the managed resources.
        /// </summary>
        /// <param name="disposing">
        /// true to release both managed and unmanaged resources; false to release only unmanaged
        /// resources.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                if (disposing)
                {
#if MONOGAME
                    _renderTarget.SafeDispose();
#endif
                }
            }

            base.Dispose(disposing);
        }
 private void RemoveRenderTarget()
 {
     lock (Lock ?? _dummyLock)
     {
         _renderTarget.SafeDispose();
         _renderTarget = null;
     }
 }