Dgby714
2010-05-11 12:10:32
Been messing with plugins for Simba and noticed Simba Errors when you free a TStringList
or there is a problem with this function =0
or there is a problem with this function =0
function OS: string;
var
AProcess: TProcess;
AStringList: TStringList;
I: integer;
begin
AProcess := TProcess.Create(nil);
AProcess.CommandLine := 'uname -a';
AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
AProcess.Execute;
AStringList := TStringList.Create;
AStringList.LoadFromStream(AProcess.Output);
AProcess.Free;
Result := '';
for I := 0 to AStringList.Count - 1 do
Result := Result + AStringList.Strings[I];
AStringList.Free; // <- Error Here
end;