StructureMap.Pipeline.LifecycleObjectCache.Eject C# (CSharp) 메소드

Eject() 공개 메소드

public Eject ( Type pluginType, StructureMap.Pipeline.Instance instance ) : void
pluginType System.Type
instance StructureMap.Pipeline.Instance
리턴 void
        public void Eject(Type pluginType, Instance instance)
        {
            int key = instance.InstanceKey(pluginType);
            _lock.MaybeWrite(() => {
                if (!_objects.ContainsKey(key)) return;

                _lock.Write(() => {
                    var disposable = _objects[key] as IDisposable;
                    _objects.Remove(key);
                    disposable.SafeDispose();
                });
            });
        }