private static void ReleaseMemory(CardModel cardModel) { if (cardModel != null) { cardModel.Dispose(); } GC.Collect(); GC.WaitForPendingFinalizers(); }