diff --git a/ChangeLog b/ChangeLog index 88fc2bac6..2dd2b3516 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-03-30 Wolfgang Lux + + * Source/GSGormLoading.m: + * Source/GSNibLoading.m: Attempt to improve a possibly misleading + comment about releasing top level objects of a gorm/nib file. + 2010-03-28 Fred Kiefer * Headers/AppKit/NSPopUpButtonCell.h diff --git a/Source/GSGormLoading.m b/Source/GSGormLoading.m index b67a1d76f..2f52bd295 100644 --- a/Source/GSGormLoading.m +++ b/Source/GSGormLoading.m @@ -276,9 +276,10 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN if ([topLevelObjects containsObject: o]) // anything already designated a top level item.. { [topObjects addObject: o]; - // All top level objects (that are not retained and - // released by other nib objects) must be released by - // the caller to avoid leaking. + // All top level objects must be released by the + // caller to avoid leaking, unless they are going + // to be released by other nib objects on behalf + // of the owner. RETAIN(o); } } diff --git a/Source/GSNibLoading.m b/Source/GSNibLoading.m index 98cf6b38e..77d1b93b8 100644 --- a/Source/GSNibLoading.m +++ b/Source/GSNibLoading.m @@ -1911,8 +1911,9 @@ static BOOL _isInInterfaceBuilder = NO; if ((v == owner || v == _root) && (obj != owner) && (obj != _root)) { [topLevelObjects addObject: obj]; - // All top level objects must be released by - // the caller to avoid leaking. + // All top level objects must be released by the caller to avoid + // leaking, unless they are going to be released by other nib + // objects on behalf of the owner. RETAIN(obj); }