Google's Go & Exceptions
"Jérôme M. Berger"
jeberger at free.fr
Wed Jan 27 10:54:22 PST 2010
Ali Çehreli wrote:
> Jérôme M. Berger wrote:
>> Throwing exception inside constructors should be avoided because
>> then the destructor is never called and you risk leaking like crazy.
>
> That's necessarily so, because calling the destructor on the incomplete
> object might cause other troubles.
>
> On the other hand, the destructors of all of the constructed members are
> called when the encapsulating object's constructor throws.
>
Does that include the parent destructor?
Jerome
--
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100127/06f08384/attachment.pgp>
More information about the Digitalmars-d
mailing list