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

Collection.addDocumentChangeListener() can fatal crash

    XMLWordPrintable

Details

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

    Description

      The function addDocumentChangeListener in Collection.swift can cause a fatal crash (SIGABRT) if the reference to the collection it was called on is gone before the change listener is called. This is because of the 'unowned' reference to self.
      Potential fixes are:
      Change to 'weak self' reference which will turn the 'self' reference into an optional, when the reference to the collection is dropped, the reference to 'self' inside the closure will be nil. 
      OR:
      Change to 'strong self' reference. This way, the change listener will ensure the reference to the Collection is retained until the ChangeListener is destroyed.

      Attachments

        Issue Links

          Activity

            People

              vlad.velicu Vlad Velicu
              pasin Pasin Suriyentrakorn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty