コード例 #1
0
        void Dispose(bool fromFinalizer)
        {
            if (cacheableState == SharpMedia.Caching.CacheableState.Disposed)
            {
                return;
            }

            cacheableState = SharpMedia.Caching.CacheableState.Disposed;
            texture2D.Release();

            if (!fromFinalizer)
            {
                GC.SuppressFinalize(this);
                texture2D = null;
            }


            // We fire events.
            Action <IResource> r = onDisposed;

            if (r != null)
            {
                r(this);
            }
        }
コード例 #2
0
        void Dispose(bool fin)
        {
            // Already disposed.
            if (cacheableState == SharpMedia.Caching.CacheableState.Disposed)
            {
                return;
            }

            texture.Release();

            if (this.view != null)
            {
                view.Dispose();
            }

            if (!fin)
            {
                GC.SuppressFinalize(this);
                texture = null;
            }

            cacheableState = SharpMedia.Caching.CacheableState.Disposed;
        }
コード例 #3
0
        void Dispose(bool fin)
        {
            if (disposed)
            {
                return;
            }

            disposed = true;

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

            texture.Release();

            if (!fin)
            {
                GC.SuppressFinalize(this);
                texture = null;
            }
        }