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;
|
TempSL : TStringList;
|
||||||
TempExt : ustring;
|
TempExt : ustring;
|
||||||
begin
|
begin
|
||||||
for i := 1 to length(aExtensions) do
|
try
|
||||||
if (aExtensions[i] = ';') then aExtensions[i] := #13;
|
for i := 1 to length(aExtensions) do
|
||||||
|
if (aExtensions[i] = ';') then aExtensions[i] := #13;
|
||||||
|
|
||||||
TempSL := TStringList.Create;
|
TempSL := TStringList.Create;
|
||||||
TempSL.Text := aExtensions;
|
TempSL.Text := aExtensions;
|
||||||
Result := '';
|
Result := '';
|
||||||
|
|
||||||
i := 0;
|
i := 0;
|
||||||
while (i < TempSL.Count) do
|
while (i < TempSL.Count) do
|
||||||
begin
|
begin
|
||||||
TempExt := TempSL[i];
|
TempExt := TempSL[i];
|
||||||
if (length(TempExt) > 1) and (TempExt[1] = '.') then
|
if (length(TempExt) > 1) and (TempExt[1] = '.') then
|
||||||
Result := Result + '*' + TempExt + ';';
|
Result := Result + '*' + TempExt + ';';
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (length(Result) > 0) and (Result[length(Result)] = ';') then
|
if (length(Result) > 0) and (Result[length(Result)] = ';') then
|
||||||
Result := copy(Result, 1, pred(length(Result)));
|
Result := copy(Result, 1, pred(length(Result)));
|
||||||
|
finally
|
||||||
|
if assigned(TempSL) then
|
||||||
|
FreeAndNil(TempSL);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCEFFileDialogInfo.CEFAcceptFilterToDialogFilter(const aAcceptFilter, aExtension, aDescription : ustring) : ustring;
|
function TCEFFileDialogInfo.CEFAcceptFilterToDialogFilter(const aAcceptFilter, aExtension, aDescription : ustring) : ustring;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 671,
|
"InternalVersion" : 672,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "130.1.10"
|
"Version" : "130.1.10"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user