```d
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?
Nick Treleaven via Digitalmars-d-learn Fri, 16 Dec 2022 04:20:54 -0800
```d
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?