Example #1
0
 private void DisposeScalabilityCache()
 {
     if (m_scalabilityCache != null)
     {
         m_totalScaleTimeMs += m_scalabilityCache.ScalabilityDurationMs;
         m_peakMemoryUsageKB = Math.Max(m_peakMemoryUsageKB, m_scalabilityCache.PeakMemoryUsageKBytes);
         m_scalabilityCache.Dispose();
         m_scalabilityCache = null;
     }
 }
 internal void DisposeGraphics()
 {
     m_textBoxDuplicates    = null;
     m_itemPaddingsStyle    = null;
     m_itemPropsStart       = null;
     m_sharedImages         = null;
     m_autosizeSharedImages = null;
     if (m_propertyCache != null)
     {
         m_propertyCacheReader = null;
         m_propertyCacheWriter = null;
         m_propertyCache.Close();
         m_propertyCache.Dispose();
     }
     if (m_bitsGraphics != null)
     {
         m_bitsGraphics.Dispose();
         m_bitsGraphics = null;
     }
     if (m_hdcBits != null)
     {
         m_hdcBits.Dispose();
         m_hdcBits = null;
     }
     if (m_scalabilityCache != null)
     {
         m_totalScaleTimeMs += m_scalabilityCache.ScalabilityDurationMs;
         m_peakMemoryUsageKB = Math.Max(m_peakMemoryUsageKB, m_scalabilityCache.PeakMemoryUsageKBytes);
         m_scalabilityCache.Dispose();
         m_scalabilityCache = null;
     }
     if (m_fontCache != null)
     {
         m_fontCache.Dispose();
         m_fontCache = null;
     }
 }