mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-07 13:48:00 -05:00
Remove some extra dispose calls on base config handler
This commit is contained in:
parent
d786d7c336
commit
b31ef6a333
@ -71,7 +71,6 @@ public class BaseConfigurationHandlerV2<TConfigurationType> : IConfigurationHand
|
||||
await using var fileStream = File.OpenRead(_path);
|
||||
readConfiguration =
|
||||
await JsonSerializer.DeserializeAsync<TConfigurationType>(fileStream, _serializerOptions);
|
||||
await fileStream.DisposeAsync();
|
||||
_watcher.Register(_path, FileUpdated);
|
||||
|
||||
if (readConfiguration is null)
|
||||
@ -131,7 +130,6 @@ public class BaseConfigurationHandlerV2<TConfigurationType> : IConfigurationHand
|
||||
|
||||
await using var fileStream = File.Create(_path);
|
||||
await JsonSerializer.SerializeAsync(fileStream, configuration, _serializerOptions);
|
||||
await fileStream.DisposeAsync();
|
||||
_configurationInstance = configuration;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -155,7 +153,6 @@ public class BaseConfigurationHandlerV2<TConfigurationType> : IConfigurationHand
|
||||
await using var fileStream = File.OpenRead(_path);
|
||||
var readConfiguration =
|
||||
await JsonSerializer.DeserializeAsync<TConfigurationType>(fileStream, _serializerOptions);
|
||||
await fileStream.DisposeAsync();
|
||||
|
||||
if (readConfiguration is null)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user