this.layer = null;
    public void detach() {        detachChildren();        if (this.layer != null) {            this.layer.detach();        }        if (getParent() != null) {            getParent().removeChild(this);        }        setParent(null);    }