SimpleTwoWayBindingIOS icon indicating copy to clipboard operation
SimpleTwoWayBindingIOS copied to clipboard

Memory Leak?

Open n13 opened this issue 6 years ago • 3 comments

I noticed that there's no support for removing an observer, and observers are held in an array.

That means that over time, as more and more views are used, the array of observers fills up with more and more items - hopefully the blocks used did not reference anything big, using weak self and so on should keep it small.

Still, I need to be able to remove observers.

Then observers could be added / removed when views willShow / willHide

n13 avatar Jun 13 '19 06:06 n13

Have same issue, due to that my viewmodel does not get released. and memory increasing. please suggest a way

iosparesh avatar Sep 25 '19 08:09 iosparesh

@manishkkatoch For what it's worth, I had to fix this issue for our app. The changes I made are pretty significant -- the bulk of them are here https://github.com/ridewithgps/SimpleTwoWayBindingIOS/commit/52650c2df81bba8907af04c36f6b2c72d2180e65 -- but I could spend some time working on a smaller PR to push the changes back here, if you'd like.

If you'd like to take this discussion off GitHub, please email me at [email protected]

fweez avatar Mar 11 '20 18:03 fweez

An unbind method requested in https://github.com/manishkkatoch/SimpleTwoWayBindingIOS/issues/4 might solve this.

malhal avatar Mar 22 '20 09:03 malhal