On Thursday, 27 February 2014 at 09:49:08 UTC, Szymon Gatner
wrote:
My crashes (still have them and can't track all as debugging D
sucks) are caused by the fact that d-tor of parent object can
be called before child d-tors. Adding destroy() calls in parent
d-tors helped with some of crashes but I really hate this
solution as I was virtually NEVER using 'delete' in C++.
Parent in the sense of an inheritance hierarchy or in the sense
of a successor relation in a graph of objects?
In the latter case the order of destruction is undefined (IMO),
i.e. if you have class A { B someB; } where B is a class as well,
than B might be already destroyed if A's destructor is run.