# HG changeset patch # User cin # Date 1512080936 -10800 # Node ID bdfdba6b645b25e430fd2e985217ac287d9e3a11 # Parent f2150c16b476ec2a4ed3070cf7d77402c59b4a75 fixed unpredictable Safe.Dispose behaviour diff -r f2150c16b476 -r bdfdba6b645b Implab/Components/ServiceLocator.cs --- a/Implab/Components/ServiceLocator.cs Wed Nov 22 16:54:58 2017 +0300 +++ b/Implab/Components/ServiceLocator.cs Fri Dec 01 01:28:56 2017 +0300 @@ -7,7 +7,7 @@ /// public class ServiceLocator: Disposable, IServiceLocator, IServiceProvider { // запись о сервисе - struct ServiceEntry : IDisposable { + class ServiceEntry : IDisposable { public object service; // сервис public bool shared; // признак того, что сервис НЕ нужно освобождать public Func activator; // активатор сервиса при первом обращении diff -r f2150c16b476 -r bdfdba6b645b Implab/Safe.cs --- a/Implab/Safe.cs Wed Nov 22 16:54:58 2017 +0300 +++ b/Implab/Safe.cs Fri Dec 01 01:28:56 2017 +0300 @@ -90,11 +90,9 @@ } public static void Dispose(object obj) { - if (obj is IDisposable) { + if (obj is IDisposable) Dispose((IDisposable)obj); - } else if (obj is IEnumerable) { - DisposeCollection((IEnumerable)obj); - } + } [DebuggerStepThrough]