[Issue 17869] scope class object no longer deleted when created via factory function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 9 11:03:02 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=17869

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |code at dawg.eu
         Resolution|---                         |WONTFIX

--- Comment #3 from Martin Nowak <code at dawg.eu> ---
It's was destroyed twice formerly, destruction was never supposed to run for GC
allocated classes.
Scope class always referred to RAII allocated classes on the stack.
The fact that you can assign heap allocated instances to variables with scope
storage was unfortunately a bug, as was the double destruction of scope class
instances assigned to other scope references.

Scope variables not pointing to stack allocated RAII classes have been
repurposed to match the semantics of scope pointers.

Sorry for any unforseen troubles this may have caused, but the existing
behavior seemed too buggy to preserve.

--


More information about the Digitalmars-d-bugs mailing list