Exemple #1
0
        override public void Dispose(bool disposing)
        {
            // If you need thread safety, use a lock around these
            // operations, as well as in your methods that use the resource.
            if (!m_disposed)
            {
                if (disposing)
                {
                    if (m_description3d != null)
                    {
                        m_description3d.Dispose();
                    }

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

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

                m_description3d   = null;
                m_secondaryBuffer = null;
                m_buffer3d        = null;

                // Indicate that the instance has been disposed.
                m_disposed = true;
            }
        }
        protected virtual void Dispose(bool disposing)
        {
            // If you need thread safety, use a lock around these
            // operations, as well as in your methods that use the resource.
            if (!m_disposed)
            {
                if (disposing)
                {
                    if (m_descriptionListener != null)
                    {
                        m_descriptionListener.Dispose();
                    }

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

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

                m_descriptionListener = null;
                m_primary3d           = null;
                m_listener3d          = null;

                // Indicate that the instance has been disposed.
                m_disposed = true;
            }
        }