ARCed.Controls.GraphicsDeviceService.Release C# (CSharp) Метод

Release() публичный Метод

Releases a reference to the singleton instance.
public Release ( bool disposing ) : void
disposing bool
Результат void
		public void Release(bool disposing)
		{
			// Decrement the "how many controls sharing the device" reference count.
			if (Interlocked.Decrement(ref referenceCount) == 0)
			{
				// If this is the last control to finish using the
				// device, we should dispose the singleton instance.
				if (disposing)
				{
					if (this.DeviceDisposing != null)
						this.DeviceDisposing(this, EventArgs.Empty);

					this.graphicsDevice.Dispose();
				}

				this.graphicsDevice = null;
			}
		}