Why does this code cause a memory leak?
If I cut down the items in the array to 250 it doesn't leak at the beginning but when I scroll up and down Instruments shows a number of leaks.
Code Block struct ContentView: View { @State var itemsX = Array(0..<500) var body: some View { List { ForEach(itemsX, id: \.self) { index in Section(header: HStack { Text(String(index, radix: 16)) Spacer() Text("Other text") }) { Text("DataText") } } } } }
If I cut down the items in the array to 250 it doesn't leak at the beginning but when I scroll up and down Instruments shows a number of leaks.