Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Short version

A finalizer gives you an opportunity to dispose of unmanaged resources in case the user of your object forgot to call IDisposable.Dispose.

If your object implements IDisposable, the user of your object must call .Dispose. You don't have to clean up the user's mess; but it's a nice thing to do.


My most popular answer on Stackoverflowmost popular answer on Stackoverflow walks you from the beginning why you have IDisposable, what it should do, what your finalizer can do, what it shouldn't do.

This answer melts faces

has been used to describe it :P

Short version

A finalizer gives you an opportunity to dispose of unmanaged resources in case the user of your object forgot to call IDisposable.Dispose.

If your object implements IDisposable, the user of your object must call .Dispose. You don't have to clean up the user's mess; but it's a nice thing to do.


My most popular answer on Stackoverflow walks you from the beginning why you have IDisposable, what it should do, what your finalizer can do, what it shouldn't do.

This answer melts faces

has been used to describe it :P

Short version

A finalizer gives you an opportunity to dispose of unmanaged resources in case the user of your object forgot to call IDisposable.Dispose.

If your object implements IDisposable, the user of your object must call .Dispose. You don't have to clean up the user's mess; but it's a nice thing to do.


My most popular answer on Stackoverflow walks you from the beginning why you have IDisposable, what it should do, what your finalizer can do, what it shouldn't do.

This answer melts faces

has been used to describe it :P

Source Link
Ian Boyd
  • 259.3k
  • 271
  • 920
  • 1.3k

Short version

A finalizer gives you an opportunity to dispose of unmanaged resources in case the user of your object forgot to call IDisposable.Dispose.

If your object implements IDisposable, the user of your object must call .Dispose. You don't have to clean up the user's mess; but it's a nice thing to do.


My most popular answer on Stackoverflow walks you from the beginning why you have IDisposable, what it should do, what your finalizer can do, what it shouldn't do.

This answer melts faces

has been used to describe it :P