Program crash: GC destroys an object unexpectedly

eugene dee0xeed at gmail.com
Thu Sep 23 14:23:40 UTC 2021


On Thursday, 23 September 2021 at 14:00:30 UTC, eugene wrote:

> For the moment I am personally quite happy

```d
void main(string[] args) {

     import core.memory : GC;

     auto Main = new Main();
     GC.addRoot(cast(void*)Main);
     Main.run();

     auto stopper = new Stopper();
     GC.addRoot(cast(void*)stopper);
     stopper.run();
```

Fine, works!



More information about the Digitalmars-d-learn mailing list