hi there, what does kotlin do when you pass a func...
# android
j
hi there, what does kotlin do when you pass a function as a param to another function? does it keep a reference to the class that contain the function that I pass as param? ie: I got an app scoped class:
Copy code
class MyClass{
  fun doSomething(fc: (String) ->Unit){}
}
and then I call to that function from my activity:
Copy code
class MyActivity:Activity{
 fun onCreate() {
    myClassSingleInstance.doSomething({anActivityProperty = it})
  }
}
I don't thing that'd leak memory but, does it? would the class keep a reference to the activity?