Add method to clear thread-local context #401

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

artgillespie commented Jan 30, 2013

When running unit tests that are asynchronous/multi-threaded, I find that oftentimes a background thread will have an NSManagedObjectContext instance (created by MR_contextForCurrentThread) from a previous set up, even after calling [MagicalRecord cleanUp]

When this happens, I get the dreaded "Object's persistent store is not reachable from this NSManagedObjectContext's coordinator" error. Removing the MOC's from each thread's threadDictionary solves the problem.

Contributor

tonyarnold commented Aug 27, 2013

Superseded by #542 (same changes, sans the merge). I need to write a couple of tests before merging into develop.

@tonyarnold tonyarnold closed this Aug 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment