On Wednesday, 22 November 2017 at 08:43:54 UTC, drug wrote:
22.11.2017 02:12, Markus пишет:
What about dtor - you allocate class using D GC but try to destroy it manually - namely this I guess gives you an error in rt_finalize2 because it tries to destroy object that has been destroyed.
hmm... I'm not sure. I compiled dmd and it's druntime in debug and I'm stepping through it. Seems there has to be a "ClassInfo" filled with data. In my case it's filled with garbage. So the call ClassInfo.destructor fails, because destructor is an invalid pointer. The GC.collect works, but doesn't call the destructor.
https://github.com/dlang/druntime/blob/3d8d4a45c01832fb657c16a656b6e1566d77fb21/src/rt/lifetime.d#L1391
I know constructors and destructors are not supported. And I get that point for move/copy... constructors. But I don't get it for simple construction and destruction.

Markus

Reply via email to