IDE: Code-Templates, fix mem leak / Correct extend of try-except block (do not hide errors, that are not expected/handled)

git-svn-id: trunk@62285 -
This commit is contained in:
martin 2019-11-22 21:22:38 +00:00
parent c93e1c6d7e
commit 67d6109619

View File

@ -5255,6 +5255,11 @@ begin
try
LoadStringsFromFileUTF8(AnAutoComplete.AutoCompleteList, s);
Result := mrOK;
except
Result := mrAbort;
end;
if Result = mrAbort then
exit;
FileVersion := AnAutoComplete.Completions.Count;
if (FileVersion > 0) then begin
@ -5271,7 +5276,7 @@ begin
j := NewAutoComplete.CompletionAttributes[i].IndexOfName(DciVersionName);
if j < 0 then
continue;
v := StrToIntDef(AnAutoComplete.CompletionAttributes[i][j], 0);
v := StrToIntDef(NewAutoComplete.CompletionAttributes[i][j], 0);
if v <= FileVersion then
continue;
if AnAutoComplete.Completions.IndexOf(NewAutoComplete.Completions[i]) >= 0 then
@ -5290,9 +5295,6 @@ begin
if BuildBorlandDCIFile(AnAutoComplete) then
SaveCodeTemplates(AnAutoComplete);
end;
except
Result := mrAbort;
end;
end
else begin
AnAutoComplete.AutoCompleteList.Text := ResourceDCIAsText;