/// <summary> /// Collect COM objects /// </summary> private void GColectorStart() { int collectorTryCount = 0; do { GC.Collect(); GC.WaitForPendingFinalizers(); collectorTryCount++; }while (Marshal.AreComObjectsAvailableForCleanup() && collectorTryCount < 20); }