|
-
May 2nd, 2006, 05:32 PM
#11
Re: Memory Leak Question
 Originally Posted by benmartin101
to completely get rid of the reference of the streamreader, you could:
strmrdr.Close();
strmrdr = null;
now the garbage collector should do its thing because strmrdr is no longer referenced.
Why wouldyou do that though? Since it's base is IDisposable, you don't have to set it to null, call Close() or Dispose(). You use it and then it's gone. Setting it to null also doesn't mean it'll automatically get cleaned up as quickly as the using statement or calling Dispose() would.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|