Gordon Waters wrote:
> procedure RunAProgram(CmmdRun: string);
> var
>   pi  : TProcessInformation;
>   si  : TStartupInfo;
> begin
>   with si do begin
>     cb := SizeOf(si);
>     lpReserved := nil;
>     lpDesktop := nil;
>     lpTitle := nil;
>     dwFlags := 0;
>     wShowWindow := SW_normal;
>     cbReserved2 := 0;
>     lpReserved2 := nil;
>   end;
>   CreateProcess(nil, PChar(cmmdRun), nil, nil, FALSE, 0, nil, nil, si, pi);
> end;

You leak a thread handle and a process handle every time you call 
RunAProgram. You need to close the handles returned in PI.

-- 
Rob
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to