[fpc-pascal] Questions About Constructors

African Wild Dog paintedlycaon at gmail.com
Fri Mar 31 19:26:54 CEST 2017


2017-03-30 4:25 GMT-03:00 Michael Van Canneyt <michael at freepascal.org>:

>
>
> On Thu, 30 Mar 2017, African Wild Dog wrote:
>
> Hello,
>>
>> 1 - What happens if my constructor raise an exception? Is my destructor
>> automatically called?
>>
>
> Yes.
>
>
>> 2 - Are the class fields automatically initialized to Default(T) just like
>> in Delphi?
>>
>
> Yes. The're zeroed out when the memory for the class is allocated.
>
>
Thanks for the clarification.
I've issued # <http://bugs.freepascal.org/view.php?id=31619>0031619
<http://bugs.freepascal.org/view.php?id=31619>  to add these details in the
documentation.


Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170331/05d1ba9a/attachment.html>


More information about the fpc-pascal mailing list