On Thursday, 23 September 2021 at 15:56:16 UTC, Steven Schveighoffer wrote:
See more details:

https://docs.microsoft.com/en-us/dotnet/api/system.gc.keepalive?view=net-5.0#remarks

"
This method references the obj parameter, making that object ineligible for garbage collection from the start of the routine to the point, in execution order, where this method is called. Code this method at the end, not the beginning, of the range of instructions where obj must be available.
"

**Code this method at the end...**

:)
it is the same as proposed by jfondren simple
writeln(stopper.sg0.number) in the end of main, right?



Reply via email to