Skip to content

Commit

Permalink
upon clearing the ks object cache, clear retained thread locals
Browse files Browse the repository at this point in the history
  • Loading branch information
kaeawc committed Oct 12, 2024
1 parent 5b6d886 commit d2cd414
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class KSObjectCacheManager {
get() = caches_prop.get()

fun register(cache: KSObjectCache<*, *>) = caches.add(cache)
fun clear() = caches.forEach { it.clear() }
fun clear() {
caches.forEach { it.clear() }
caches_prop.remove()
}
}
}

Expand All @@ -44,5 +47,8 @@ abstract class KSObjectCache<K, V> {
return cache_prop.get()
}

open fun clear() = cache.clear()
open fun clear() {
cache.clear()
cache_prop.remove()
}
}

0 comments on commit d2cd414

Please sign in to comment.