BIND icon indicating copy to clipboard operation
BIND copied to clipboard

Fix reference counting

Open aspcartman opened this issue 9 years ago • 3 comments

I don't know how this could possibly work, but if you create a new application, add this lib and just try to BINDO with -observe: it won't work, because right after the creation of the binding it gets deallocated: BNDBinding is not retained. You had an NSMutableSet, where you add BNDBindings, but now it's gone and only BNDBindingKVOObserver are retained by association. But they have a weak reference to parent BNDBinding. That's a fail.

To fix this we must make BNDBindingKVOObservers to hold strong reference to parent BNDBinding.

aspcartman avatar Feb 25 '16 11:02 aspcartman

Ping, maaan

aspcartman avatar Mar 19 '16 17:03 aspcartman

Hey @aspcartman sorry I'm super busy with other stuff. Had a brief look at it, and I think you might be right. The way we're using BINDO is always by keeping the reference to the BNDBinding that gets returned. I need more time to test your fix though, thanks for spotting this.

markohlebar avatar Mar 21 '16 18:03 markohlebar

@markohlebar thanks :)

aspcartman avatar Mar 21 '16 18:03 aspcartman