@ -109,13 +109,13 @@ namespace Emby.Server.Implementations
/// <summary>
/// <summary>
/// The disposable parts.
/// The disposable parts.
/// </summary>
/// </summary>
private readonly Concurrent Dictionary< IDisposable , byt e> _disposableParts = new ( ) ;
private readonly Concurrent Bag< IDisposabl e> _disposableParts = new ( ) ;
private readonly DeviceId _deviceId ;
private readonly DeviceId _deviceId ;
private readonly IConfiguration _startupConfig ;
private readonly IConfiguration _startupConfig ;
private readonly IXmlSerializer _xmlSerializer ;
private readonly IXmlSerializer _xmlSerializer ;
private readonly IStartupOptions _startupOptions ;
private readonly IStartupOptions _startupOptions ;
private readonly I PluginManager _pluginManager ;
private readonly PluginManager _pluginManager ;
private List < Type > _creatingInstances ;
private List < Type > _creatingInstances ;
@ -161,7 +161,7 @@ namespace Emby.Server.Implementations
ApplicationPaths . PluginsPath ,
ApplicationPaths . PluginsPath ,
ApplicationVersion ) ;
ApplicationVersion ) ;
_disposableParts . Try Add( ( PluginManager ) _pluginManager , byte . MinValue ) ;
_disposableParts . Add( _pluginManager ) ;
}
}
/// <summary>
/// <summary>
@ -360,7 +360,7 @@ namespace Emby.Server.Implementations
{
{
foreach ( var part in parts . OfType < IDisposable > ( ) )
foreach ( var part in parts . OfType < IDisposable > ( ) )
{
{
_disposableParts . Try Add( part , byte . MinValue ) ;
_disposableParts . Add( part ) ;
}
}
}
}
@ -381,7 +381,7 @@ namespace Emby.Server.Implementations
{
{
foreach ( var part in parts . OfType < IDisposable > ( ) )
foreach ( var part in parts . OfType < IDisposable > ( ) )
{
{
_disposableParts . Try Add( part , byte . MinValue ) ;
_disposableParts . Add( part ) ;
}
}
}
}
@ -457,7 +457,7 @@ namespace Emby.Server.Implementations
serviceCollection . AddSingleton < IServerConfigurationManager > ( ConfigurationManager ) ;
serviceCollection . AddSingleton < IServerConfigurationManager > ( ConfigurationManager ) ;
serviceCollection . AddSingleton < IConfigurationManager > ( ConfigurationManager ) ;
serviceCollection . AddSingleton < IConfigurationManager > ( ConfigurationManager ) ;
serviceCollection . AddSingleton < IApplicationHost > ( this ) ;
serviceCollection . AddSingleton < IApplicationHost > ( this ) ;
serviceCollection . AddSingleton (_pluginManager ) ;
serviceCollection . AddSingleton <IPluginManager > (_pluginManager ) ;
serviceCollection . AddSingleton < IApplicationPaths > ( ApplicationPaths ) ;
serviceCollection . AddSingleton < IApplicationPaths > ( ApplicationPaths ) ;
serviceCollection . AddSingleton < IFileSystem , ManagedFileSystem > ( ) ;
serviceCollection . AddSingleton < IFileSystem , ManagedFileSystem > ( ) ;
@ -965,7 +965,7 @@ namespace Emby.Server.Implementations
Logger . LogInformation ( "Disposing {Type}" , type . Name ) ;
Logger . LogInformation ( "Disposing {Type}" , type . Name ) ;
foreach ( var ( part , _ ) in _disposableParts )
foreach ( var part in _disposableParts . ToArray ( ) )
{
{
var partType = part . GetType ( ) ;
var partType = part . GetType ( ) ;
if ( partType = = type )
if ( partType = = type )