http://d.puremagic.com/issues/show_bug.cgi?id=5353
Simen Kjaeraas <simen.kja...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simen.kja...@gmail.com --- Comment #3 from Simen Kjaeraas <simen.kja...@gmail.com> 2010-12-14 16:35:59 PST --- Highly interesting: copying the clear function of object_.d in druntime to my own module, the destructor is called but once. void myclear(T)(ref T obj) if (is(T == struct)) { static if (is(typeof(obj.__dtor()))) { obj.__dtor(); } auto buf = (cast(void*) &obj)[0 .. T.sizeof]; auto init = (cast(void*) &T.init)[0 .. T.sizeof]; buf[] = init[]; } struct test { ~this( ) { writeln( "dtor!" ); } } void main( ) { test* p = new test; clear( *p ); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------