From 057a8505891eac41d8c97d32fb5f3c4e27d4012f Mon Sep 17 00:00:00 2001 From: Pavel Kunyavskiy Date: Fri, 27 Oct 2023 12:52:45 +0200 Subject: [PATCH] Fix widget leak --- src/backend/src/main/kotlin/org/icpclive/data/Manager.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/src/main/kotlin/org/icpclive/data/Manager.kt b/src/backend/src/main/kotlin/org/icpclive/data/Manager.kt index 1e3e43e3e..c3d0d7cb9 100644 --- a/src/backend/src/main/kotlin/org/icpclive/data/Manager.kt +++ b/src/backend/src/main/kotlin/org/icpclive/data/Manager.kt @@ -26,6 +26,7 @@ abstract class ManagerWithEvents : Manager() { protected abstract fun createSnapshotEvent(items: List): 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)) }