コード例 #1
0
        /// <summary>
        /// Simply forward to <see cref="ClassHolder.Dispose"/> on <see cref="m_Class"/>
        /// when called for the first time.
        /// <see cref="StopFilters"/>
        /// </summary>
        public void Dispose()
        {
            // Time to stop all filters
            StopFilters();

            // Forward
            if (null != m_Class)
            {
                m_Class.Dispose();
            }

            // Once
            m_Class = null;

            // No need to finalize
            GC.SuppressFinalize(this);
        }
コード例 #2
0
        /// <summary>
        /// On first call the call is forwarded to <see cref="ClassHolder.Dispose"/> of
        /// <see cref="m_Class"/>.
        /// </summary>
        /// <remarks>
        /// Prior to the destruction of the C++ instance <see cref="DataDMA"/>
        /// is used to disable DMA access. Any <see cref="Exception"/> from this
        /// call is ignored.
        /// </remarks>
        public void Dispose()
        {
            // Shutdown class
            if (null != m_Class)
            {
                // Reset DMA
                try { DataDMA = false; }
                catch (Exception) { }

                // Done
                m_Class.Dispose();
            }

            // Once
            m_Class = null;

            // No need to finalize
            GC.SuppressFinalize(this);
        }
コード例 #3
0
        /// <summary>
        /// Simply forward to <see cref="ClassHolder.Dispose"/> on <see cref="m_Class"/>
        /// when called for the first time.
        /// </summary>
        public void Dispose()
        {
            // Go down
            if (m_Open)
            {
                Close();
            }

            // Forward
            if (null != m_Class)
            {
                m_Class.Dispose();
            }

            // Once
            m_Class = null;

            // No need to finalize
            GC.SuppressFinalize(this);
        }
コード例 #4
0
        /// <summary>
        /// Beendet den Empfang.
        /// </summary>
        /// <param name="remove">Gesetzt, wenn auch eine Abmeldung bei dem zugehörige Gerät erwünscht ist.</param>
        private void InternalStop(bool remove)
        {
            // Remove from frontend
            if (remove)
            {
                if (m_Frontend != null)
                {
                    // Remove
                    m_Frontend.RemoveFilter(m_streamIdentifier);

                    // Forget
                    m_Frontend = null;
                }
            }

            // Discard registered handler
            m_DataHandler = null;

            // Nothing to do
            if (m_Class == null)
            {
                return;
            }

            // With cleanup
            try
            {
                // Terminate
                Suspend();
            }
            finally
            {
                // Remove C++ instance
                m_Class.Dispose();

                // Detach from object
                m_Class = null;
            }
        }