On Friday, 13 August 2021 at 19:59:46 UTC, Mike Parker wrote:
You aren't supposed to be manipulating GC-managed memory via
class destructors. You can not rely on that memory being valid
at the time that it's accessed in the destructor---the object
may already have been destroyed. Nondeterministic destruction
is the price you pay for letting the GC manager your object
memory.
Of course, in this case, the problem will only crop up at
termination since the array is declared at module scope so will
be live up until the GC shuts down. But still, not something
you should be doing.
...
Thank you very much. The program runs successfully now.