Sign in Join

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

Mailing lists / lazarus / 2000-09

TObject.Free problem ??

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Unknown author

A quick question about free pascal's TObject. Is there a problem with TObject.Free not checking for a nil Self or am I on the wrong train here. How does lazarus deal with an exception which occurs during the execution of a constructor?

Pouppah

______________________________________________________ Listen to your favorite music while you work!
- http://www.com/

Reply by email

Michael Van Canneyt
to Unknown author
A quick question about free pascal's TObject. Is there a problem with TObject.Free not checking for a nil Self or am I on the wrong train here.

It does:

        procedure TObject.Free;
        begin
           // the call via self avoids a warning
           if selfnil then
             self.destroy;
        end;
How does lazarus deal with an exception which occurs during the execution of a constructor?

You must explicitly catch them.

Michael.

Reply by email