Re: properly disposing of filestream
- From: Lasse Vågsæther Karlsen <lasse@xxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 09:17:42 +0200
Bob wrote:
Oh well, I guess I will redo this with using. Thanks for all your
input. Michael, do you think this would work if I ran as standalone
from exe instead of from Visual Studio?
I don't understand your remarks about "using".
As long as you make sure you actually call the Dispose method when you're done with your object, it should be fine. It should not matter *how* Dispose was called.
Seeing the code that uses your object would perhaps give us a clue, as would more explanation of how you're treating the object.
I suspect, however, that you're not calling Dispose and you trust GC to do it, which it won't.
Also, as remarked by others, GC.Collect() is typically not necessary and you should instead have a really good reason for using it.
--
Lasse Vågsæther Karlsen
mailto:lasse@xxxxxxxxxxx
.
- References:
- properly disposing of filestream
- From: Bob
- Re: properly disposing of filestream
- From: Michael Nemtsev , MVP
- Re: properly disposing of filestream
- From: Bob
- properly disposing of filestream
- Prev by Date: Re: Correct usage of the volatile keyword
- Next by Date: Re: VS2005 Resource Editor - How to make new line from string resource?
- Previous by thread: Re: properly disposing of filestream
- Next by thread: Re: properly disposing of filestream
- Index(es):
Relevant Pages
|