On Friday, 29 January 2016 at 12:43:53 UTC, Dsby wrote:
the Code:
~this(){ GC.free(by.ptr); by = null; writeln("free"); }
Your problem is probably that you are calling GC.free in the destructor. Don't do this. You don't need to call GC.free at all. The GC will collect both your object instance and the memory you allocated with new. Never, ever, manipulate GC memory in the destructor of a GC-managed object.