From 7aff5cd60a458c5cea8e113414d9fcd1e32c107c Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 7 Jun 2024 11:07:37 -0400 Subject: [PATCH] ConfigXmlReader is an IDisposable; Dispose it This was flagged by a static analysis tool. Is this necessary? Is this safe to do? --- .../src/System/Configuration/AppSettingsSection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/AppSettingsSection.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/AppSettingsSection.cs index fa1377743f789f..d34b2757a1ab9d 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/AppSettingsSection.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/AppSettingsSection.cs @@ -127,7 +127,7 @@ protected internal override void DeserializeElement(XmlReader reader, bool seria } } - ConfigXmlReader internalReader = new ConfigXmlReader(rawXml, sourceFileFullPath, lineOffset); + using ConfigXmlReader internalReader = new ConfigXmlReader(rawXml, sourceFileFullPath, lineOffset); internalReader.Read(); if (internalReader.MoveToNextAttribute())