Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread David Emerson
On Wednesday 23 July 2008 7:46 pm, Marc Santhoff wrote: > That's interesting and nice. Can I assume the same is valid for dyn > arrays in a procedure or function context? The short answer is yes. There was recently (about a month ago) a discussion about some of these very issues, from 21 to 29 J

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Marc Santhoff
Am Mittwoch, den 23.07.2008, 19:21 +0200 schrieb Luca Olivetti: > El Wed, 23 Jul 2008 17:15:13 +0200 > Marc Santhoff <[EMAIL PROTECTED]> escribió: > > > That's the important part, I'm dealing with cleanly freeing strings > > when destroying objects. > > I may be wrong but I think you don't need t

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Marc Santhoff
Am Mittwoch, den 23.07.2008, 17:10 -0300 schrieb Joao Morais: > Luca Olivetti wrote: > > El Wed, 23 Jul 2008 17:15:13 +0200 > > Marc Santhoff <[EMAIL PROTECTED]> escribió: > > > >> That's the important part, I'm dealing with cleanly freeing strings > >> when destroying objects. > > > > I may be w

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Mattias Gaertner
On Wed, 23 Jul 2008 22:54:08 +0200 Luca Olivetti <[EMAIL PROTECTED]> wrote: > En/na Mattias Gaertner ha escrit: > > >> [*]though I know of at least a nasty leak with gtk2 under lazarus > >> that heaptrc didn't trace. > > > > Which one? > > http://bugs.freepascal.org/view.php?id=9259 > (I just n

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Luca Olivetti
En/na Mattias Gaertner ha escrit: [*]though I know of at least a nasty leak with gtk2 under lazarus that heaptrc didn't trace. Which one? http://bugs.freepascal.org/view.php?id=9259 (I just noticed you fixed it, but heaptrc didn't report anything when I first discovered it). Bye -- Luca

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Joao Morais
Luca Olivetti wrote: El Wed, 23 Jul 2008 17:15:13 +0200 Marc Santhoff <[EMAIL PROTECTED]> escribió: That's the important part, I'm dealing with cleanly freeing strings when destroying objects. I may be wrong but I think you don't need to do anything, when you free a class the memory used by s

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Mattias Gaertner
On Wed, 23 Jul 2008 19:21:00 +0200 Luca Olivetti <[EMAIL PROTECTED]> wrote: > El Wed, 23 Jul 2008 17:15:13 +0200 > Marc Santhoff <[EMAIL PROTECTED]> escribió: > > > That's the important part, I'm dealing with cleanly freeing strings > > when destroying objects. > > I may be wrong but I think you

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Luca Olivetti
El Wed, 23 Jul 2008 17:15:13 +0200 Marc Santhoff <[EMAIL PROTECTED]> escribió: > That's the important part, I'm dealing with cleanly freeing strings > when destroying objects. I may be wrong but I think you don't need to do anything, when you free a class the memory used by string fields is autom

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Marc Santhoff
Am Mittwoch, den 23.07.2008, 08:28 +0100 schrieb Jonas Maebe: > On 23 Jul 2008, at 06:32, Marc Santhoff wrote: > > > I understand right that (as I have asked before) an empty (ansi)string > > is equal to NIL. > > True. > > > If this is correct, is setting a string to '' the same as setting the >

Re: [fpc-pascal] freeing string equal to setting to empty string?

2008-07-23 Thread Jonas Maebe
On 23 Jul 2008, at 06:32, Marc Santhoff wrote: I understand right that (as I have asked before) an empty (ansi)string is equal to NIL. True. If this is correct, is setting a string to '' the same as setting the string to NIL? No. So i can e.g. use exchagably: {$H+} var s: string; begi

[fpc-pascal] freeing string equal to setting to empty string?

2008-07-22 Thread Marc Santhoff
Hi, I understand right that (as I have asked before) an empty (ansi)string is equal to NIL. If this is correct, is setting a string to '' the same as setting the string to NIL? So i can e.g. use exchagably: {$H+} var s: string; begin s := 'something'; { this ... } s := ''; { ... wo