From 93c2af9d9f10a2e5c4694514c5bf89655a0e8680 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 09:28:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Free=20the=20light=20config=20do?= =?UTF-8?q?cument=20and=20tolerate=20a=20missing=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LoadConfig leaked the parsed XML document on every call and aborted startup when the color config file was absent. --- Client/ULightManager.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Client/ULightManager.pas b/Client/ULightManager.pas index 2560928..62b880b 100644 --- a/Client/ULightManager.pas +++ b/Client/ULightManager.pas @@ -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 }