MapEditor.GraphicsDeviceServiceMiniMap.Release C# (CSharp) Method

Release() public method

Releases a reference to the singleton instance.
public Release ( bool disposing ) : void
disposing bool
return 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 (DeviceDisposing != null)
                        DeviceDisposing(this, EventArgs.Empty);

                    graphicsDevice.Dispose();
                }

                graphicsDevice = null;
            }
        }