icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development

Home Page:https://moko.icerock.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ios m.leaks

aplha98 opened this issue · comments

hello, plz help me
I am using cflowState , cflow extension, the issue I have a lot of memory leaks on IOS,
on IOS
In the viewModels

 func releaseDisposableHandle(){
        disposableHandle.dispose()
    }
    

in the swiftui view

Vstack{}
            .onDisappear {
            vm.releaseDisposableHandle()
            }

let us say I have screens
A -> B -> C
I did not want to dispose of B until C is disappear, sometimes the user go to C and back to B , how to manage the scope of VM life
does DisposableHandle work?

hi.
what is disposableHandle in your code?

also, are you use weak references in lambda on swift side?