Beispiel #1
0
 /// <summary>
 /// Checks and reports leaks for handle monitoring.
 /// </summary>
 public void CheckLeaks()
 {
     lock (this)
     {
         bool reportedFirstLeak = false;
         if (_handleCount > 0)
         {
             for (int i = 0; i < NumberOfBuckets; i++)
             {
                 HandleEntry e = _buckets[i];
                 while (e != null)
                 {
                     if (!e.ignorableAsLeak)
                     {
                         if (!reportedFirstLeak)
                         {
                             Debug.WriteLine("\r\nHandle leaks detected for handles of type " + name + ":");
                             reportedFirstLeak = true;
                         }
                         Debug.WriteLine(e.ToString(this));
                     }
                     e = e.next;
                 }
             }
         }
     }
 }
 /// <include file='doc\DebugHandleTracker.uex' path='docs/doc[@for="DebugHandleTracker.HandleType.CheckLeaks"]/*' />
 /// <devdoc>
 ///     Checks and reports leaks for handle monitoring.
 /// </devdoc>
 public void CheckLeaks()
 {
     lock (this) {
         if (handleCount > 0)
         {
             Debug.WriteLine("\r\nHandle leaks detected for handles of type " + name + ":");
             for (int i = 0; i < BUCKETS; i++)
             {
                 HandleEntry e = buckets[i];
                 while (e != null)
                 {
                     Debug.WriteLine(e.ToString(this));
                     e = e.next;
                 }
             }
         }
     }
 }