cloudant / CDTDatastore

Cloudant Sync iOS datastore library.
Apache License 2.0
175 stars 53 forks source link

Fix retain cycle between CDTQIndexManager and CDTDatastore #428

Closed tomblench closed 6 years ago

tomblench commented 6 years ago

What

Fix retain cycle between CDTQIndexManager and CDTDatastore

How

Make a weak reference to the associated object from the CDTDatastore to the CDTQIndexManager. Because it isn't reference counted, the CDTQIndexManager instance dealloc is correctly called (it didn't before because its reference count never reached 0), at which point the reference is cleared.

Testing

See added test class CDTQLifecycleTests

Issues

Fixes #426

ricellis commented 6 years ago

@tomblench before you merge this also needs a CHANGELOG entry