AdvancedLauncher.Tools.Interop.HwndSourceHost.Dispose C# (CSharp) Method

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected override void Dispose(bool disposing)
        {
            if (disposing) {
                // Walk the visual tree looking for disposable elements.
                if (_hwndSource != null) {
                    UIElement root = _hwndSource.RootVisual as UIElement;
                    if (root != null) {
                        root.DisposeSubTree();
                    }

                    _hwndSource.Dispose();
                    _hwndSource = null;
                }
            }

            base.Dispose(disposing);
        }