From 03799fa720b4b07d22deecfadbd0b2c13583362b Mon Sep 17 00:00:00 2001 From: Sebastian Lobato Genco Date: Tue, 5 Nov 2024 21:06:25 +0100 Subject: [PATCH] Fix Android SDK 35 problem --- .../kotlin/com/sebaslogen/resaca/ScopedViewModelContainer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resaca/src/commonMain/kotlin/com/sebaslogen/resaca/ScopedViewModelContainer.kt b/resaca/src/commonMain/kotlin/com/sebaslogen/resaca/ScopedViewModelContainer.kt index f3e33ff7..0e4713a7 100644 --- a/resaca/src/commonMain/kotlin/com/sebaslogen/resaca/ScopedViewModelContainer.kt +++ b/resaca/src/commonMain/kotlin/com/sebaslogen/resaca/ScopedViewModelContainer.kt @@ -359,7 +359,7 @@ public class ScopedViewModelContainer : ViewModel(), LifecycleEventObserver { // Cancel all coroutines, Closeables and ViewModels hosted in this object val objectsToClear: MutableList = scopedObjectsContainer.values.toMutableList() while (objectsToClear.isNotEmpty()) { - val lastObject = objectsToClear.removeLast() + val lastObject = objectsToClear.removeAt(objectsToClear.lastIndex) clearLastDisposedObject(lastObject, objectsToClear) } scopedObjectKeys.clear() // Clear all keys