public void Dispose() { parent.Boards.Remove(this); boardItems.Clear(); selected.Clear(); layers.Clear(); GC.Collect(); GC.WaitForPendingFinalizers(); }
public void Dispose() { lock (parent) { parent.Boards.Remove(this); boardItems.Clear(); selected.Clear(); mapLayers.Clear(); } // This must be called when MultiBoard is unlocked, to prevent BackupManager deadlocking parent.OnBoardRemoved(this); GC.Collect(); GC.WaitForPendingFinalizers(); }