I am looking at some JS ViewModel code that uses this template to be able to refer to an external closure if any library changes the "this" pointer when calling the function as a callback (must like JavaScript):
function FruitViewModel { var that = this;
My question is: will this cause a memory leak or will it be specific? (e.g. if garbage collects inside out and out)
Edit: suppose that the moment the GC considers this object for a collection, nothing contains a reference to someCallBack .
source share