public static void CheckLeaks() {
lock(internalSyncObject) {
if (CompModSwitches.HandleLeak.Level >= TraceLevel.Warning) {
GC.Collect();
GC.WaitForPendingFinalizers();
HandleType[] types = new HandleType[handleTypes.Values.Count];
handleTypes.Values.CopyTo(types, 0);
Debug.WriteLine("------------Begin--CheckLeaks--------------------");
for (int i = 0; i < types.Length; i++) {
if (types[i] != null) {
types[i].CheckLeaks();
}
}
Debug.WriteLine("-------------End--CheckLeaks---------------------");
}
}
}