Apple has a known problem 
<http://inessential.com/2013/12/20/observers_and_thread_safety> with KVO 
where, if you are receiving a notification on a different dispatch queue 
than they are triggered on, then the call to `observeValueForKeyPath` can 
happen while the object is deallocating.  I caught my code doing this with 
live query observation (yay, unit tests!), and I'm trying to figure out how 
to prevent this situation from coming up in the future.  

Am I correct in thinking that the live query is being updated on 
Couchbase-lite's queue, as apposed to my own serial dispatch queue where 
the live query was created?  If so, then is it either possible or a good 
idea to run my call to addObserver on the same dispatch queue as the one 
where the live query is being updated?

Is there a better way to deal with this issue???

Thanks for the help!

Jordan

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/b10661a2-f31b-46d7-8413-2f177f0e4c66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to