Closed felixLam closed 10 years ago
Previously the following line would crash if this was the first interaction with the model, because g_instancesReadLock was not initialized.
g_instancesReadLock
dispatch_semaphore_wait(g_instancesReadLock, DISPATCH_TIME_FOREVER);
The following lines would also not work without this change:
if (! classCache) classCache = g_instances[(id) self.class] = [NSMapTable strongToWeakObjectsMapTable];
Thanks!
One more thought: currently this method gets called in three locations, would it maybe make sense to call it once in openDatabaseAtPath instead?
openDatabaseAtPath
Previously the following line would crash if this was the first interaction with the model, because
g_instancesReadLock
was not initialized.The following lines would also not work without this change: