internal void Free()
 {
     m_tracker.CancelAll();
     foreach (var pool in m_pools.Values)
     {
         foreach (var shape in pool)
         {
             shape.RemoveReference();
         }
     }
     m_pools.Clear();
 }
Exemplo n.º 2
0
 internal void Free()
 {
     m_tracker.CancelAll();
     using (m_poolLock.AcquireExclusiveUsing())
     {
         foreach (var pool in m_pools.Values)
         {
             foreach (var model in pool.Values)
             {
                 foreach (var shape in model)
                 {
                     shape.RemoveReference();
                 }
             }
         }
         m_pools.Clear();
     }
 }
        internal void Free()
        {
            HashSet <IntPtr> releasedShapes = new HashSet <IntPtr>();

            m_tracker.CancelAll();
            using (m_poolLock.AcquireExclusiveUsing())
            {
                foreach (var pool in m_pools.Values)
                {
                    foreach (var model in pool.Values)
                    {
                        foreach (var shape in model)
                        {
                            if (releasedShapes.Contains(shape.NativeDebug))
                            {
                                string error = "Shape " + shape.Name + " was referenced twice in the pool!";
                                System.Diagnostics.Debug.Assert(false, error);
                                MyLog.Default.WriteLine(error);
                            }
                            releasedShapes.Add(shape.NativeDebug);
                        }
                    }
                }

                foreach (var pool in m_pools.Values)
                {
                    foreach (var model in pool.Values)
                    {
                        foreach (var shape in model)
                        {
                            var native = shape.NativeDebug;
                            shape.RemoveReference();
                        }
                    }
                }
                m_pools.Clear();
            }
        }
 internal void CancelAllRequests()
 {
     m_renderWorkTracker.CancelAll();
 }