Fix ForEach crashing when removing items

This commit is contained in:
david-swift 2025-09-03 13:29:41 +02:00
parent 4eb58b154c
commit 3388d05ceb

View File

@ -61,7 +61,6 @@ public struct ForEach<Element>: AdwaitaWidget where Element: Identifiable {
functions: .init { index in
let child = contentStorage[safe: index]?.opaquePointer
gtk_box_remove(widget, child?.cast())
g_object_unref(child?.cast())
contentStorage.remove(at: index)
} insert: { index, element in
let child = content(element).storage(data: data, type: type)