+dataWasUpdatedExternally is called after a custom importing operation
If at least one of the classes has no loaded instances, postChangeNotification:changedFields:instance: is called with the instance parameter set to nil.
In postChangeNotification:changedFields:instance:, a nil value on instance results in a lock initialized with NULL.
dispatch_semaphore_wait is called with lock at NULL.
Crash!
I would have done a pull request, but I'm not sure how this should be fixed. Should we avoid calling -postChangeNotification:changedFields:instance: when no instances are loaded?
Thanks. Simple oversight when changing that into a static method: locks aren't class-specific, so they should all just be called on self and assumed to be FCModel's top-level lock.
Here's a quick rundown of the crash:
+dataWasUpdatedExternally
is called after a custom importing operationpostChangeNotification:changedFields:instance:
is called with theinstance
parameter set tonil
.postChangeNotification:changedFields:instance:
, anil
value oninstance
results in alock
initialized withNULL
.dispatch_semaphore_wait
is called withlock
atNULL
.I would have done a pull request, but I'm not sure how this should be fixed. Should we avoid calling
-postChangeNotification:changedFields:instance:
when no instances are loaded?