Re: memory leak or not?
- From: "Marina Levit [MVP]" <someone@xxxxxxxxxx>
- Date: Wed, 1 Nov 2006 11:33:57 -0500
No, when the variable is out of scope, it becomes eligible for garbage
collection.
"docschnipp" <docschnipp@xxxxxxxxxxxxxxxx> wrote in message
news:D52F0CD9-91F8-4238-A100-19BAC61089BA@xxxxxxxxxxxxxxxx
Does such a function result in a memory leak because of not explicitely
setting result = null?
------------------
public override string GetValueAsString()
{
StringBuilder result = new StringBuilder(10);
result.Append(Month.AsString());
result.Append('/');
result.Append(Day.AsString());
result.Append('/');
result.Append(Year.AsString());
return result.ToString();
}
------------------
Or does the compiler automatically gets that "result" goes off focus now?
best regards,
doc
.
- Follow-Ups:
- Re: memory leak or not?
- From: Jon Skeet [C# MVP]
- Re: memory leak or not?
- Prev by Date: Re: Transaction and RowState problem
- Next by Date: Re: if else in datagrid item template
- Previous by thread: Re: Converting form C# alias type to .NET framework type
- Next by thread: Re: memory leak or not?
- Index(es):