This code segfaults when the GC calls the dtor after the unittest succeeds:
unittest
{
int i;
struct S
{
~this() { i++; }
}
(*new S).destroy;
}
It seems destroy clears the context pointer. Is there a way to test if the context pointer is null in the dtor, to prevent the increment?