[Issue 5353] clear function is calling the destructor twice

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 15 06:21:44 PST 2010


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


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|nobody at puremagic.com        |schveiguy at yahoo.com


--- Comment #6 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-12-15 06:19:56 PST ---
Figured out the problem.  The runtime creates a temporary copy of the struct in
order to copy over the initial value.

It is fixed by copying the TypeInfo.init data.

I'll check in a change after the beta is released (don't want to interfere with
that).

But long story short, your dtor is getting called twice, but the first time it
is called, it's on a default-constructed instance, so it shouldn't cause a
problem.

-- 
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