Skip to content

Commit

Permalink
Fix widget leak
Browse files Browse the repository at this point in the history
  • Loading branch information
kunyavskiy committed Nov 4, 2023
1 parent 793ce49 commit 057a850
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/src/main/kotlin/org/icpclive/data/Manager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ abstract class ManagerWithEvents<in T : TypeWithId, E> : Manager<T>() {
protected abstract fun createSnapshotEvent(items: List<T>): E

override suspend fun add(item: T) = mutex.withLock {
items.removeIf { it.id == item.id } // We don't need the remove event, as create considered as the set on frontend.
items.add(item)
sendEvent(createAddEvent(item))
}
Expand Down

0 comments on commit 057a850

Please sign in to comment.