Re: memory leak or not?
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Fri, 3 Nov 2006 18:24:10 +0100
Jon,
My text was not meant as you read it.
I was implying that there was a new object instanced, and not only a new
reference to an existing object.
object A = MyJonObject;
is different from
string A = MyJonObject.ToString();
As it had been a "normal" reference type the object would in my idea not be
garbaged. (As it is not done in this case, to but the created string is
again a new object and that will be garbaged)
Marina was in my idea talking about normal non immutable reference types.
However I can of course not speak for here. Your sample is in my idea an
exception to the standard behaviour..
Cor
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> schreef in bericht
news:MPG.1fb4fd74a108f76298d5be@xxxxxxxxxxxxxxxxxxxxxxx
Cor Ligthert [MVP] <notmyfirstname@xxxxxxxxx> wrote:
Um, just because it's immutable doesn't mean that string isn't a
reference type.
That is exactly why I wrote it.
But you implied that string isn't a reference type. It is. You wrote:
<quote>
The string is immutable what you are showing is not a reference.
</quote>
What I was showing most certainly *is* a reference.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: memory leak or not?
- From: Jon Skeet [C# MVP]
- Re: memory leak or not?
- References:
- Re: memory leak or not?
- From: Marina Levit [MVP]
- Re: memory leak or not?
- From: Jon Skeet [C# MVP]
- Re: memory leak or not?
- From: Cor Ligthert [MVP]
- Re: memory leak or not?
- From: Jon Skeet [C# MVP]
- Re: memory leak or not?
- From: Cor Ligthert [MVP]
- Re: memory leak or not?
- From: Jon Skeet [C# MVP]
- Re: memory leak or not?
- Prev by Date: Re: Array question.
- Next by Date: Re: what property or method should I use in combo box to
- Previous by thread: Re: memory leak or not?
- Next by thread: Re: memory leak or not?
- Index(es):
Relevant Pages
|