diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs index 40c91979db..0c8646508f 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs @@ -381,6 +381,7 @@ namespace MediaBrowser.Common.Implementations if (disposable != null) { Logger.Info("Registering " + disposable.GetType().Name); + DisposableParts.Add(disposable); } } @@ -458,7 +459,10 @@ namespace MediaBrowser.Common.Implementations if (manageLiftime) { - DisposableParts.AddRange(parts.OfType()); + lock (DisposableParts) + { + DisposableParts.AddRange(parts.OfType()); + } } return parts;