Skip to content

Commit 83a069e

Browse files
Clean out the LogContext childContexts array when a new subcontext is added.
Should prevent unbounded growth of the context array for contexts with lots of short-lived children.
1 parent 6673f0f commit 83a069e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/kotlin/org/jitsi/utils/logging2/LogContext.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class LogContext private constructor(
6363
ancestorsContext + context,
6464
childContextData
6565
).also {
66+
childContexts.removeIf { r -> r.get() == null }
6667
childContexts.add(WeakReference(it))
6768
}
6869

0 commit comments

Comments
 (0)