mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 18:20:00 +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
|
||||
xml := TXMLConfig.Create(fn[i]);
|
||||
exp := TKeyCommandRelationList.Create;
|
||||
nm := xml.GetValue('Name/Value','');
|
||||
if nm = '' then nm := ExtractFileName(fn[i]);
|
||||
if (dst.IndexOf(nm)<0) then begin
|
||||
exp.DefineCommandCategories; // default Relations
|
||||
exp.LoadFromXMLConfig(xml, 'KeyMapping/', false);
|
||||
dst.AddObject(nm, exp);
|
||||
try
|
||||
nm := xml.GetValue('Name/Value','');
|
||||
if nm = '' then nm := ExtractFileName(fn[i]);
|
||||
if (dst.IndexOf(nm)<0) then begin
|
||||
exp.DefineCommandCategories; // default Relations
|
||||
exp.LoadFromXMLConfig(xml, 'KeyMapping/', false);
|
||||
dst.AddObject(nm, exp);
|
||||
exp := nil;
|
||||
end;
|
||||
finally
|
||||
xml.Free;
|
||||
exp.Free;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user