Re: [fpc-pascal] destructor

2017-02-01 Thread Nitorami
As I understand this: It may sometimes well be necessary to write your own destructor to clean up. But if you do this, don't call it foo; call it destructor and override it: destructor destroy; override; In your own destructor method, don't forget to call inherited in the end. -- View this me

Re: [fpc-pascal] destructor

2017-01-24 Thread Mattias Gaertner
On Tue, 24 Jan 2017 15:33:30 +0100 Maciej Izak wrote: > 2017-01-24 12:48 GMT+01:00 Mattias Gaertner : > > > fpc allows to declare a method with the destructor keyword, that is > > not a real destructor, because it does not free the memory. For what is > > this feature good for? > > > > with t

Re: [fpc-pascal] destructor

2017-01-24 Thread Maciej Izak
2017-01-24 12:48 GMT+01:00 Mattias Gaertner : > fpc allows to declare a method with the destructor keyword, that is > not a real destructor, because it does not free the memory. For what is > this feature good for? > with trunk works as expected (Foo does call FreeInstance). -- Best regards, Ma

[fpc-pascal] destructor

2017-01-24 Thread Mattias Gaertner
Hi, fpc allows to declare a method with the destructor keyword, that is not a real destructor, because it does not free the memory. For what is this feature good for? For example: Type TClassA = class public destructor Foo; end; destructor TClassA.Foo; begin end; var o: TClass; begin

Re: [fpc-pascal] destructor TDecompressionStream.Destroy question

2007-09-21 Thread David Mears
Michael Van Canneyt wrote: > On Thu, 20 Sep 2007, David Mears wrote: > > >> from fpc/packages/fcl-base/src/inc/zstream.pp >> >> I'm not really sure why this is in the destructor for tdecompressionstream. >> >> if FZRec.avail_in <> 0 then >> Source.Seek(-FZRec.i, soFromCurrent); >> > >

Re: [fpc-pascal] destructor TDecompressionStream.Destroy question

2007-09-20 Thread Michael Van Canneyt
On Thu, 20 Sep 2007, David Mears wrote: > from fpc/packages/fcl-base/src/inc/zstream.pp > > I'm not really sure why this is in the destructor for tdecompressionstream. > > if FZRec.avail_in <> 0 then > Source.Seek(-FZRec.avail_in, soFromCurrent); To reposition the source stream on the l

[fpc-pascal] destructor TDecompressionStream.Destroy question

2007-09-20 Thread David Mears
from fpc/packages/fcl-base/src/inc/zstream.pp I'm not really sure why this is in the destructor for tdecompressionstream. if FZRec.avail_in <> 0 then Source.Seek(-FZRec.avail_in, soFromCurrent); my tdecompressionstream is fed by a tideadecryptstream - when tdecompressionstream is freed it