Brendan Weinstein
11/20/2023, 9:09 PMComposeUIViewController that wraps a UIKitView that wraps a native ios view.
I am pretty sure the offending code is tied to passing a function reference that produces the native view to kotlin
let mapboxVC = Mapbox_iosKt.createMapboxVC(
createMapView: { [weak self] in
MapWidget(frame: self!.view.frame) }
)
let secondViewController = SecondViewController()
navigationController?.pushViewController(mapboxVC, animated: true)
Has anyone else dealt with this and can recommend a workaround?
What's bizarre is if I switch to using ios' default navigation bar for back navigation, then I cannot reproduce the memory leak. I've tried wrapping the function reference in a WeakReference on the kotlin side and clearing the WeakReference when UIKitView::release is called. I've also tried making my own ReferenceHolder class on the swift side that can nil out the MapWidget reference when UIKitView::release is called. Neither approach has mitigated the memory leak.लातों वाला भूत
11/20/2023, 9:35 PMBrendan Weinstein
11/20/2023, 10:05 PMलातों वाला भूत
11/20/2023, 10:21 PMBrendan Weinstein
11/20/2023, 10:24 PM1.9.20 and compose 1.5.10लातों वाला भूत
11/20/2023, 10:25 PMBrendan Weinstein
11/20/2023, 10:25 PMThe leak of ComposeWindow itself (but not all associated resources) is fixed in this PRLooks like the ack that there might be more mem leaks even after that fix. I'll work on drafting up an issue for that repo
लातों वाला भूत
11/20/2023, 10:26 PMBrendan Weinstein
11/20/2023, 10:27 PMBrendan Weinstein
11/20/2023, 10:45 PMलातों वाला भूत
11/25/2023, 5:39 PMBrendan Weinstein
11/26/2023, 5:03 AMलातों वाला भूत
11/26/2023, 5:08 AMBrendan Weinstein
11/26/2023, 5:22 AM