[fpc-devel] FreeInstance

Thorsten Engler thorsten.engler at gmx.net
Tue Jul 31 17:48:01 CEST 2018


I don't think it's called anywhere in the source. It's called by the compiler after the destructor has finished. The same way that InitInstance is run before the constructor is called.

This way the memory for the object is already allocated before the first constructor is run (and not only after calling inherited and getting all the way to TObject) and it is only freed after the destructor has completed (so again, you aren't in limbo after calling inherited in the destructor).

> -----Original Message-----
> From: fpc-devel <fpc-devel-bounces at lists.freepascal.org> On Behalf
> Of Ryan Joseph
> Sent: Wednesday, 1 August 2018 01:36
> To: FPC developers' list <fpc-devel at lists.freepascal.org>
> Subject: [fpc-devel] FreeInstance
> 
> Looking at the FPC source now and it appears FreeInstance is a
> hidden method which is not called from the TObject destructor.
> 
> Where/how is this method called in the source? I’ve been in the
> debugger for over an hour and I still can’t find it.
> 
> Regards,
> 	Ryan Joseph
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list