Dispose command line args enumerator

This commit is contained in:
Hao Kung 2016-07-05 15:20:17 -07:00
Родитель e53f86abe5
Коммит d8f96d72e8
1 изменённых файлов: 71 добавлений и 69 удалений

Просмотреть файл

@ -46,7 +46,8 @@ namespace Microsoft.Extensions.Configuration.CommandLine
var data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); var data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
string key, value; string key, value;
var enumerator = Args.GetEnumerator(); using (var enumerator = Args.GetEnumerator())
{
while (enumerator.MoveNext()) while (enumerator.MoveNext())
{ {
var currentArg = enumerator.Current; var currentArg = enumerator.Current;
@ -128,6 +129,7 @@ namespace Microsoft.Extensions.Configuration.CommandLine
// Override value when key is duplicated. So we always have the last argument win. // Override value when key is duplicated. So we always have the last argument win.
data[key] = value; data[key] = value;
} }
}
Data = data; Data = data;
} }