Dispose vs Dispose(bool)

IDisposable provides a method with the signature

public void Dispose()

Microsoft best practices (Implement a Dispose method) recommend making a second private method with the signature

private void Dispose(bool)

Your public Dispose method and finalizer should call this private Dispose method to prevent disposing managed resources multiple times.

You can fix the warning you are getting by either implementing IDisposable and disposing of your font object in the dispose method, or creating a Dispose(bool) method in your class, and make your finalizer call that method.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)