[fpc-devel] FreeAndNil implementation

Thorsten Engler thorsten.engler at gmx.net
Mon Feb 5 02:59:39 CET 2007

> Here is an interesting reading: 
> http://blogs.codegear.com/abauer/archive/2006/11/01/28852.aspx
> Maybe, the suggested FreeAndNil implementation can be 
> usefull. See in comments.
Feel free to take it... But it's x86 specific asm code...

> BTW: Is the bellow afirmation also valid for fpc??
> "we alluded to the fact that while the constructor of an object is 
> executing, if any exception is raised the destructor will 
> automatically 
> be called, the object will be freed and the exception is allowed to 
> continue on its merry way."

That is correct for FPC as well. And since it got fixed FPC doesn't even
execute AfterConstruction and BeforeDestruction anymore in case of an
exception in the constructor.


More information about the fpc-devel mailing list