public void Dispose() { if (fontObject != IntPtr.Zero) { Status status = GDIPlus.GdipDeleteFont(fontObject); fontObject = IntPtr.Zero; GC.SuppressFinalize(this); // check the status code (throw) at the last step GDIPlus.CheckStatus(status); } }