fix: destroying a parent should also destroy its children

This commit is contained in:
Géry Debongnie
2019-01-27 21:03:13 +01:00
parent 138e5dc231
commit fb6ad6e56b
2 changed files with 74 additions and 0 deletions
+3
View File
@@ -98,6 +98,9 @@ export class Widget<T extends WEnv> {
destroy() {
if (!this.__widget__.isDestroyed) {
for (let id in this.__widget__.children) {
this.__widget__.children[id].destroy();
}
if (this.__widget__.isMounted) {
this.willUnmount();
}