Permalink
Browse files

Merge pull request #22 from nvie/master

This is just a simple fix to prevent unintentional releases of the default MOC.
  • Loading branch information...
2 parents ba8609c + 8d9e636 commit 4c16b3709f99fb08846acd3296222622172a1d94 @casademora casademora committed May 12, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 NSManagedObjectContext+ActiveRecord.m
@@ -30,8 +30,10 @@ + (NSManagedObjectContext *)defaultContext
+ (void) setDefaultContext:(NSManagedObjectContext *)moc
{
- [defaultManageObjectContext release];
- defaultManageObjectContext = [moc retain];
+ if (defaultManageObjectContext != moc) {
+ [defaultManageObjectContext release];
+ defaultManageObjectContext = [moc retain];
+ }
}
+ (void) resetDefaultContext

0 comments on commit 4c16b37

Please sign in to comment.