Description
Currently CBLCollection is strongly retained inside CBLDocumentChangeNotifier which is also kept inside the CBLCollection's _docChangeNotifiers map. This is causing a retain cycle. The only way to break the retain cycle now is to remove the document listener token. However, there is no requirement that the document listener token needs to be removed.
The fix for this is to change CBLDocumentChangeNotifier to weakly retain its CBLCollection object. The side effect of this is that users will need to retain the CBLCollection object in order to receive the events. Noted that this is the current behavior of the collection change listener.
Attachments
Issue Links
- Clones
-
CBL-4440 CBLCollection could be leaked if document listener token is not removed
- Closed