Example #1
0
        /// <summary>
        /// Dispose pattern implementation of dispose method.
        /// </summary>
        /// <param name="disposing">True if disposing, false if finalizing.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (Disposed)
            {
                return;
            }

            if (MirrorTexturePtr != IntPtr.Zero)
            {
                OVR.DestroyMirrorTexture(Session, MirrorTexturePtr);
                MirrorTexturePtr = IntPtr.Zero;

                // Notify subscribers that this object has been disposed.
                if (ObjectDisposed != null)
                {
                    ObjectDisposed(this);
                }
            }

            GC.SuppressFinalize(this);

            Disposed = true;
        }