[Issue 704] destructors are called even if the constructor throws an exception

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 19 23:16:57 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=704


Lionello Lunesu <lio+bugzilla at lunesu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lio+bugzilla at lunesu.com


--- Comment #6 from Lionello Lunesu <lio+bugzilla at lunesu.com> 2011-11-19 23:16:05 PST ---
(In reply to comment #5)
> Default initializing object's fields doesn't mean full object construction. I
> do believe that an object should be considered constructed only if its
> constructor has completed successfully. Otherwise, the constructor should clean
> after itself and only deallocator (if any), but not destructor, should be run.
> Currently, deallocator is not run, meaning another bug in the compiler.

for what it's worth: C# still calls the finalizer when the ctor throws.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list