G
Gabriel Lozano-Morán
I have always read that forms that are shown modally through ShowDialog()
need to be disposed manually. Because they are not disposed automatically
since you can still access the form after the ShowDialog() call.
We were having a discussion about why you need to call the Dispose(). I
thought that the garbage collector does not calls the destructor because of
the window handle. Can someone tell me what the real reason is that you need
to manually dispose() a modally shown form?
What happens if you don't dispose the form, won't the garbage collector
destroy the form on the managed heap or will you have leaks or what?
Gabriel Lozano-Morán
need to be disposed manually. Because they are not disposed automatically
since you can still access the form after the ShowDialog() call.
We were having a discussion about why you need to call the Dispose(). I
thought that the garbage collector does not calls the destructor because of
the window handle. Can someone tell me what the real reason is that you need
to manually dispose() a modally shown form?
What happens if you don't dispose the form, won't the garbage collector
destroy the form on the managed heap or will you have leaks or what?
Gabriel Lozano-Morán