DEV: call destroy() on widget when glue is cleaned up (#8338)
This commit is contained in:
parent
3b36326cb7
commit
38a18b7aa0
|
@ -54,6 +54,18 @@ export default class WidgetGlue {
|
|||
}
|
||||
|
||||
cleanUp() {
|
||||
const widgets = [];
|
||||
const findWidgets = widget => {
|
||||
widget.vnode.children.forEach(child => {
|
||||
if (child.constructor.name === "CustomWidget") {
|
||||
widgets.push(child);
|
||||
findWidgets(child, widgets);
|
||||
}
|
||||
});
|
||||
};
|
||||
findWidgets(this._tree, widgets);
|
||||
widgets.reverse().forEach(widget => widget.destroy());
|
||||
|
||||
cancel(this._timeout);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue