Recursively destroy all Controllers

        The method remove all controllers, which calls the destroy method of the child controllers. Then,
        all registered models are relieved and and the widget hand by the initial view argument is destroyed.
519289
def destroy(self):
        
        self.disconnect_all_signals()
        controller_names = [key for key in self.__child_controllers]
        for controller_name in controller_names:
            self.remove_controller(controller_name)
        self.relieve_all_models()
        if self.parent:
            self.__parent = None
        if self._view_initialized:
            # print(self.__class__.__name__, "destroy view", self.view, self)
            self.view.get_top_widget().destroy()
            self.view = None
            self._Observer__PROP_TO_METHS.clear()  # prop name --> set of observing methods
            self._Observer__METH_TO_PROPS.clear()  # method --> set of observed properties
            self._Observer__PAT_TO_METHS.clear() # like __PROP_TO_METHS but only for pattern names (to optimize search)
            self._Observer__METH_TO_PAT.clear()  # method --> pattern
            self._Observer__PAT_METH_TO_KWARGS.clear()  # (pattern, method) --> info
            self.observe = None
        else:
            logger.warning("The controller {0} seems to be destroyed before the view was fully initialized. {1} "
                           "Check if you maybe do not call {2} or there exist most likely threading problems."
                           "".format(self.__class__.__name__, self.model, ExtendedController.register_view))
1299593
public int clear()
    {
        int n = 0;
        for (GVRCursorController c : controllers)
        {
            c.stopDrag();
            removeCursorController(c);
            ++n;
        }
        return n;
    }
1053824
void destroy() {
        if (onSettled != null) {
            onSettled.run();
        }

        if (pendingReleaseInstances != null) {
            for (PendingReleaseInstance i : pendingReleaseInstances) {
                try {
                    Mvc.graph().dereference(i.instance, i.type, i.qualifier);
                } catch (ProviderMissingException e) {
                    //should not happen
                    //in case this happens just logs it
                    navigationManager.logger.warn("Failed to auto release {} after navigation settled", i.type.getName());
                }
            }
        }
    }
790148
public function actionDeleteAll()
    {
        if(isset($_POST['items'])) {
            foreach($_POST['items'] as $id) {
                $this->findModel($id)->deleteWithChildren();
            }
        }
    }
894439
function () {
            removeButtonEventHandlers.call(this);

            this._aButtons = null;

            var aForms = this.element.getElementsByTagName("form"),
                oForm;

            if (aForms.length > 0) {
                oForm = aForms[0];

                if (oForm) {
                    Event.purgeElement(oForm);
                    if (oForm.parentNode) {
                        oForm.parentNode.removeChild(oForm);
                    }
                    this.form = null;
                }
            }
            Dialog.superclass.destroy.call(this);
        }
1069715
public function destroy()
    {
        parent::destroy();
        foreach ($this->parameters as $param) {
            $param->destroy();
        }
        $this->parameters = [];
    }
227979
function() {
        if (this.layers || this.map) {
            var i, layers = this.layers || this.map.layers;
            for (i=layers.length-1; i>=0; --i) {
                this.removeLayer({layer: layers[i]});
            }
        }
        if (this.map) {
            this.map.events.un({
                addlayer: this.addLayer,
                removeLayer: this.removeLayer,
                scope: this
            });
        }
        OpenLayers.Control.prototype.destroy.apply(this, arguments);
    }
1090340
function () {
            // free some property objects
            if (this.renderable) {
                this.renderable.destroy.apply(this.renderable, arguments);
                this.children.splice(0, 1);
            }

            // call the parent destroy method
            this._super(me.Renderable, "destroy", arguments);
        }
778241
function()
	{
		if(this._collectionBinder)
		{
			this._collectionBinder.destroyBoundViews();
		}
		else
		{
			var subView, i, l;

			// Destroy subviews
			if(this.subviews !== null)
			{
				for(i = 0, l = this.subviews.length; i < l; i++)
				{
					subView = this.subviews[i];
					subView.destroyAll();
				}
			}
			this.subviews = null;
			this._subviewsStruct = null;
		}
	}
728334
function() {
        if (this.map) {
            this.map.events.un({
                "removelayer": this.handleMapEvents,
                "changelayer": this.handleMapEvents,
                scope: this
            });
        }
        this.layer = null;
        OpenLayers.Control.prototype.destroy.apply(this, []);
    }
1037922
def destroy(self):
        
        widget = self.widget
        if widget is not None:
            del self.widget
        super(UiKitToolkitObject, self).destroy()
358835
def del_controller(self):
        
        command = ovs_vsctl.VSCtlCommand('del-controller', [self.br_name])
        self.run_command([command])
401359
public final void removeChildRouter(@NonNull Router childRouter) {
        if ((childRouter instanceof ControllerHostedRouter) && childRouters.remove(childRouter)) {
            childRouter.destroy(true);
        }
    }
1298638
public void destroy() {

        m_attributeName = null;
        m_attributeType = null;
        m_attributeValueViews.clear();
        m_attributeValueViews = null;
        m_dndHandler = null;
        m_entity = null;
        m_entityType = null;
        m_entityBackEnd = null;
        m_widgetService = null;
    }
370810
public synchronized void removeAllSceneObjects() {
        final GVRCameraRig rig = getMainCameraRig();
        final GVRSceneObject head = rig.getOwnerObject();
        rig.removeAllChildren();

        NativeScene.removeAllSceneObjects(getNative());
        for (final GVRSceneObject child : mSceneRoot.getChildren()) {
            child.getParent().removeChildObject(child);
        }

        if (null != head) {
            mSceneRoot.addChildObject(head);
        }

        final int numControllers = getGVRContext().getInputManager().clear();
        if (numControllers > 0)
        {
            getGVRContext().getInputManager().selectController();
        }

        getGVRContext().runOnGlThread(new Runnable() {
            @Override
            public void run() {
                NativeScene.deleteLightsAndDepthTextureOnRenderThread(getNative());
            }
        });
    }
845829
@Override
    public void clear() {
        templateURICache.clear();
        deployedViewURICache.clear();
        controllerNameCache.clear();
        noSuffixViewURICache.clear();
    }
751765
protected void removeAllChildren() {

        for (int i = getGroupContainerWidget().getWidgetCount() - 1; i >= 0; i--) {
            Widget widget = getGroupContainerWidget().getWidget(i);
            if (widget instanceof CmsContainerPageElementPanel) {
                widget.removeFromParent();
            }
        }
    }