17.07.2023 15:45, Alain De Vos пишет:
This works also:[snipped]
Despite this time you use new you still allocate your class on stack using scope and its scope still is `dofun`. But I just want to inform you. Your solutions work. Don't get me wrong.
N.B. I would say if you do not have THE reason to manually free memory - do not do this. At all. Just let GC does its work.