mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 12:36:15 +02:00
IDE: reduce memleaks when loading custom keyscheme, based on part of patch by Dean Mustakinov, issue #40559
(cherry picked from commit a187c73c68
)
This commit is contained in:
parent
91c3bf3781
commit
dd0b913271
@ -4375,12 +4375,18 @@ begin
|
|||||||
try
|
try
|
||||||
xml := TXMLConfig.Create(fn[i]);
|
xml := TXMLConfig.Create(fn[i]);
|
||||||
exp := TKeyCommandRelationList.Create;
|
exp := TKeyCommandRelationList.Create;
|
||||||
nm := xml.GetValue('Name/Value','');
|
try
|
||||||
if nm = '' then nm := ExtractFileName(fn[i]);
|
nm := xml.GetValue('Name/Value','');
|
||||||
if (dst.IndexOf(nm)<0) then begin
|
if nm = '' then nm := ExtractFileName(fn[i]);
|
||||||
exp.DefineCommandCategories; // default Relations
|
if (dst.IndexOf(nm)<0) then begin
|
||||||
exp.LoadFromXMLConfig(xml, 'KeyMapping/', false);
|
exp.DefineCommandCategories; // default Relations
|
||||||
dst.AddObject(nm, exp);
|
exp.LoadFromXMLConfig(xml, 'KeyMapping/', false);
|
||||||
|
dst.AddObject(nm, exp);
|
||||||
|
exp := nil;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
xml.Free;
|
||||||
|
exp.Free;
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user