<p>Am 31.03.2017 19:27 schrieb "African Wild Dog" <<a href="mailto:paintedlycaon@gmail.com">paintedlycaon@gmail.com</a>>:<br>
><br>
> 2017-03-30 4:25 GMT-03:00 Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>>:<br>
>><br>
>><br>
>><br>
>> On Thu, 30 Mar 2017, African Wild Dog wrote:<br>
>><br>
>>> Hello,<br>
>>><br>
>>> 1 - What happens if my constructor raise an exception? Is my destructor<br>
>>> automatically called?<br>
>><br>
>><br>
>> Yes.<br>
>><br>
>>><br>
>>> 2 - Are the class fields automatically initialized to Default(T) just like<br>
>>> in Delphi?<br>
>><br>
>><br>
>> Yes. The're zeroed out when the memory for the class is allocated.<br>
>><br>
><br>
> Thanks for the clarification.<br>
> I've issued #0031619 to add these details in the documentation.</p>
<p>Keep in mind however that the second behavior can be changed by overriding TObject.NewInstance (the default implementation allocates the memory of the class and zeroes it).</p>
<p>Regards,<br>
Sven</p>