Skip to content
Browse files

Add method to clear context from thread storage.

  • Loading branch information...
1 parent 477049d commit 9b82db445acb958d518f1d4f70b4159b64618118 @artgillespie committed
View
1 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h
@@ -12,5 +12,6 @@
+ (NSManagedObjectContext *) MR_contextForCurrentThread;
+ (void) MR_resetContextForCurrentThread;
++ (void) MR_clearContextForCurrentThread;
@end
View
4 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.m
@@ -38,4 +38,8 @@ + (NSManagedObjectContext *) MR_contextForCurrentThread;
}
}
++ (void) MR_clearContextForCurrentThread {
+ [[[NSThread currentThread] threadDictionary] removeObjectForKey:kMagicalRecordManagedObjectContextKey];
+}
+
@end

0 comments on commit 9b82db4

Please sign in to comment.
Something went wrong with that request. Please try again.