Program crash: GC destroys an object unexpectedly

eugene dee0xeed at gmail.com
Wed Sep 22 12:22:45 UTC 2021


On Wednesday, 22 September 2021 at 11:44:16 UTC, Steven 
Schveighoffer wrote:
> Once it's on the stack, the GC can see it for the full run of 
> `main`. This is why this case is different.
>
> Note that Java is even more aggressive, and might *still* 
> collect it, because it could legitimately set `stopper` to null 
> after the last use to signify that it's no longer needed.

And it follows that programming in GC-supporting languages
*may* be harder than in languages with manual memory
management, right?



More information about the Digitalmars-d-learn mailing list