Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-02

FreeAndNil implementation

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luiz Americo

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.

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."

Complete story here:
http://blogs.codegear.com/abauer/archive/2006/11/03/28916.aspx

Luiz

Reply by email

Thorsten Engler
to Luiz Americo
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...

Show quoted text 7 lines
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.

Cheers,
Thorsten

Reply by email