diff --git a/CWOPS.pas b/CWOPS.pas index b09b139..5493aed 100644 --- a/CWOPS.pas +++ b/CWOPS.pas @@ -54,6 +54,7 @@ function TCWOPS.LoadCallHistory(const AUserCallsign : string) : boolean; slst:= TStringList.Create; tl:= TStringList.Create; + CWO := nil; try CWOPSList.Clear; @@ -64,7 +65,9 @@ function TCWOPS.LoadCallHistory(const AUserCallsign : string) : boolean; for i:= 0 to slst.Count-1 do begin self.Delimit(tl, slst.Strings[i]); if (tl.Count = 4) then begin - CWO:= TCWOPSRec.Create; + if CWO = nil then + CWO:= TCWOPSRec.Create; + CWO.Call:= UpperCase(tl.Strings[0]); CWO.Name:= UpperCase(tl.Strings[1]); CWO.Number:= tl.Strings[2]; @@ -76,8 +79,7 @@ function TCWOPS.LoadCallHistory(const AUserCallsign : string) : boolean; if length(CWO.Name) > 12 then continue; CWOPSList.Add(CWO); - - + CWO := nil; end; end; @@ -86,6 +88,7 @@ function TCWOPS.LoadCallHistory(const AUserCallsign : string) : boolean; finally slst.Free; tl.Free; + if CWO <> nil then CWO.Free; end;