Dispose() protected method

Releases the resources used by Persistence
protected Dispose ( bool disposing ) : void
disposing bool
return void
Example #1
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// -----------------------------------------------------------------------------------
        protected override void Dispose(bool fDisposing)
        {
            System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            base.Dispose(fDisposing);

            if (fDisposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
                if (m_draftView != null)
                {
                    m_draftView.Dispose();
                }
                if (m_isNewCache && (m_cache != null))
                {
                    m_cache.Dispose();                     // Only if we made it.
                }
                if (m_Persistence != null)
                {
                    m_Persistence.Dispose();
                }
            }
            m_cache       = null;
            m_draftView   = null;
            m_styleSheet  = null;
            m_rootb       = null;
            m_Persistence = null;
        }