Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-4443

CBLCollection could be leaked if document listener token is not removed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.1.1
    • 3.1.0
    • iOS
    • Security Level: Public
    • None
    • C-iOS 106
    • 2

    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

          Activity

            People

              pasin Pasin Suriyentrakorn
              pasin Pasin Suriyentrakorn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty