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

Collection.addDocumentChangeListener() can fatal crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.1.1
    • 3.1.0
    • iOS
    • Security Level: Public
    • None
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              pasin Pasin Suriyentrakorn
              callum.birks Callum Birks
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty