summaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Widget.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
index 9c6941b7..aaddbe39 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt
@@ -115,6 +115,10 @@ open class Widget(classes: Set<String> = setOf()) : KVObject {
vnode = v
if (ov.elm !== v.elm) afterInsert(v)
}
+ destroy = { _ ->
+ vnode = null
+ afterDestroy()
+ }
}
return hooks
}
@@ -175,4 +179,7 @@ open class Widget(classes: Set<String> = setOf()) : KVObject {
protected open fun afterInsert(node: VNode) {
}
+
+ protected open fun afterDestroy() {
+ }
}