Hello,
I detected a problem and tried to isolate it in a minimal test application.
Always reproducible error (computer restarted for clean memory)
Configuration:
Windows 10 64bit
Lazarus 2.0.2 FPC 3.0.4 64bit
The problem only occurs if the following option is active:
Project options -> Debugging -> "Use Heaptrc unit (check for mem-leaks) (-gh)"
I attach the source for the test and the images of the error.
I could use the alternative commented code but the other one seems correct to me.
Any help is welcome