/// <include file='Funq.xdoc' path='docs/doc[@for="Container.Dispose"]/*'/> public void Dispose() { while (disposables.Count > 0) { var wr = disposables.Pop(); var disposable = (IDisposable)wr.Target; if (wr.IsAlive) { disposable.Dispose(); } } var children = childContainers; childContainers = null; foreach (var child in children) { child.Dispose(); } if (parent != null) { parent.ReleaseChild(this); } }