I am creating a process from my Delphi 7 application. I wait for it to complete and then continue execution of my program. Here is my code:
FillChar(StartupInfo, SizeOf(StartupInfo), 0);
FillChar(ProcessInfo, SizeOf(ProcessInfo), 0);
if CreateProcess(nil, PChar(CommandLine), nil, nil, True, 0, nil, nil, StartupInfo, ProcessInfo) then
until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
It works fine. My problem is that Memory Sleuth indicates that there is a Thread Handle and a Process Handle still allocated once my application terminates.
My question is, how do I free these resources?