Resource leak if a TThread destroyed without ever executing its code
Original Reporter info from Mantis: Gorelkin
-
Reporter name: Sergei Gorelkin
Original Reporter info from Mantis: Gorelkin
- Reporter name: Sergei Gorelkin
Description:
Originally reported at http://lists.lazarus.freepascal.org/pipermail/lazarus/2010-October/056098.html
Happens at least on Windows platforms; need to investigate if similar case applies to other platforms.
Creating a suspended TThread and immediately destroying it causes a TThreadInfo record allocated in SysBeginThread to leak, because it is currently only freed either when the thread actually starts execution or when OS fails to create a thread.
I attach a testcase without Lazarus dependencies.