Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#finalization queue and GC.CollectSingle-choice MCQ

A class has a finalizer and also implements IDisposable with the standard Dispose(bool)/GC.SuppressFinalize pattern. If a caller forgets to call Dispose, what is the precise sequence of GC events that reclaims the object's memory?

~Resource() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); }