Post

Replies

Boosts

Views

Activity

List entries / section leaks memory, says Instruments
Hello all, I currently encounter a strange issue in my app which I also can reproduce in a minimal example. Lets say we just have an application with this code: // ContentView.swift var body: some View { NavigationSplitView { List { Section("Header") { Text("Text") } } } detail: { } } Running the app just works fine but running it in Instruments results in a memory leak at object NSMutableIndexSet. Why is that? Taking a more complex example where the view is refreshed based on the result of a function, it leaks even more increasing memory usage. Example code: var body: some View { NavigationSplitView { List { Section("Header") { ForEach(someClass?.functionReturningArrayOfStrings() ?? [String](), id: \.self) { item in Text(item) } } } } detail: { } } Removing either the Sectionor the entries like Textfixes the memory leak, according to Instruments. Is this a bug I stumbled upon or something I misunderstood here? I also opened a bug report for now, number is: 12388668 Kind regards, Jan
2
0
988
Jun ’23