mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-15 07:45:56 +01:00
Fixed memory leak in TCEFFileDialogInfo.ConvertExtensions
This commit is contained in:
parent
f0f3e99c04
commit
3d93de5edb
@ -220,24 +220,29 @@ var
|
||||
TempSL : TStringList;
|
||||
TempExt : ustring;
|
||||
begin
|
||||
for i := 1 to length(aExtensions) do
|
||||
if (aExtensions[i] = ';') then aExtensions[i] := #13;
|
||||
try
|
||||
for i := 1 to length(aExtensions) do
|
||||
if (aExtensions[i] = ';') then aExtensions[i] := #13;
|
||||
|
||||
TempSL := TStringList.Create;
|
||||
TempSL.Text := aExtensions;
|
||||
Result := '';
|
||||
TempSL := TStringList.Create;
|
||||
TempSL.Text := aExtensions;
|
||||
Result := '';
|
||||
|
||||
i := 0;
|
||||
while (i < TempSL.Count) do
|
||||
begin
|
||||
TempExt := TempSL[i];
|
||||
if (length(TempExt) > 1) and (TempExt[1] = '.') then
|
||||
Result := Result + '*' + TempExt + ';';
|
||||
inc(i);
|
||||
end;
|
||||
i := 0;
|
||||
while (i < TempSL.Count) do
|
||||
begin
|
||||
TempExt := TempSL[i];
|
||||
if (length(TempExt) > 1) and (TempExt[1] = '.') then
|
||||
Result := Result + '*' + TempExt + ';';
|
||||
inc(i);
|
||||
end;
|
||||
|
||||
if (length(Result) > 0) and (Result[length(Result)] = ';') then
|
||||
Result := copy(Result, 1, pred(length(Result)));
|
||||
if (length(Result) > 0) and (Result[length(Result)] = ';') then
|
||||
Result := copy(Result, 1, pred(length(Result)));
|
||||
finally
|
||||
if assigned(TempSL) then
|
||||
FreeAndNil(TempSL);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCEFFileDialogInfo.CEFAcceptFilterToDialogFilter(const aAcceptFilter, aExtension, aDescription : ustring) : ustring;
|
||||
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 671,
|
||||
"InternalVersion" : 672,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "130.1.10"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user