Skip to content
This repository was archived by the owner on Aug 10, 2024. It is now read-only.

Commit 16ccd50

Browse files
committed
minor memory leak mitigation
1 parent 01d3893 commit 16ccd50

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/main/kotlin/kweb/ElementCreator.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ if (insertBefore !== undefined) {
204204
} catch (e: Exception) {
205205
logger.warn(e) { "Error while cleaning up ElementCreator" }
206206
}
207+
// Reduce likelihood of memory leaks
208+
this.cleanupListeners?.clear()
207209
}
208210
}
209211

src/main/kotlin/kweb/state/KVal.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ open class KVal<T : Any?>(value: T) : AutoCloseable{
137137
}
138138
}
139139

140-
protected fun finalize() {
141-
this.close(CloseReason("Garbage Collected"))
142-
}
143-
144140
}
145141

146142
operator fun <O : Any> KVal<List<O>>.plus(other : KVal<List<O>>) : KVal<List<O>> {

0 commit comments

Comments
 (0)