🚨 Free the light config document and tolerate a missing file
LoadConfig leaked the parsed XML document on every call and aborted startup when the color config file was absent.
This commit is contained in:
@@ -385,7 +385,10 @@ begin
|
||||
|
||||
//frmInitialize.SetStatusLabel(Format(frmInitialize.SplashLoading, ['ColorLight.xml']));
|
||||
// Read xml file from your hard drive
|
||||
if not FileExists(AFileName) then
|
||||
Exit;
|
||||
ReadXMLFile(XMLDoc, AFileName);
|
||||
try
|
||||
if LowerCase(XMLDoc.DocumentElement.NodeName) = 'colorlight' then
|
||||
begin
|
||||
iNode := XMLDoc.DocumentElement.FirstChild;
|
||||
@@ -462,6 +465,9 @@ begin
|
||||
iNode := iNode.NextSibling;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
XMLDoc.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TLightSource }
|
||||
|
||||
Reference in New Issue
Block a user