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
- is cloned by
-
CBL-4441 Collection.addDocumentChangeListener() can fatal crash
- Closed