diff --git a/ChangeLog b/ChangeLog index 3316d29..66c7f72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ * EOAccess/EOEntity.m (-dealloc): Add missing calls to release, reorganize. + * EOAccess/EOEntity.m: Break retain cycle for parent/sub entities. + 2006-10-22 Matt Rice * EOAccess/EOPrivate.h: Add notification constants. diff --git a/EOAccess/EOEntity.m b/EOAccess/EOEntity.m index d6563d8..873d384 100644 --- a/EOAccess/EOEntity.m +++ b/EOAccess/EOEntity.m @@ -574,6 +574,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat - (void) dealloc { + [_subEntities makeObjectsPerform:@selector(_setParentEntity:) withObject:nil]; [_attributes makeObjectsPerform:@selector(setParent:) withObject:nil]; [_relationships makeObjectsPerform:@selector(setEntity:) withObject:nil]; // this must come after _attributes is cleared. @@ -607,7 +608,6 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat DESTROY(_hiddenRelationships); DESTROY(_internalInfo); DESTROY(_name); - DESTROY(_parent); DESTROY(_primaryKeyAttributes); DESTROY(_primaryKeyAttributeNames); DESTROY(_propertiesToFault); // never initialized? @@ -2485,7 +2485,7 @@ createInstanceWithEditingContext:globalID:zone: - (void)_setParentEntity: (EOEntity *)parent { [self willChange]; // TODO: verify - ASSIGN(_parent, parent); + _parent = parent; } - (NSDictionary *)snapshotForRow: (NSDictionary *)aRow