@@ -99,12 +99,6 @@ - (void)dealloc
9999 [_accessoryView removeFromSuperview ];
100100 _accessoryView = nil ; // weak ref
101101 }
102- [_separatorPositions release ];
103- [_groups release ];
104- [_identifiers release ];
105- [_selectedItems release ];
106-
107- [super dealloc ];
108102}
109103
110104
@@ -124,15 +118,10 @@ - (void)reloadData
124118
125119 NSArray *subviews = [[self subviews ] copy ]; // so we don't mutate the collection we're iterating over.
126120 [subviews makeObjectsPerformSelector: @selector (removeFromSuperview )];
127- [subviews release ]; // because copies are retained.
128121
129- [_separatorPositions release ];
130122 _separatorPositions = nil ;
131- [_groups release ];
132123 _groups = nil ;
133- [_identifiers release ];
134124 _identifiers = nil ;
135- [_selectedItems release ];
136125 _selectedItems = nil ;
137126 _firstCollapsedGroup = NSNotFound ;
138127 _lastWidth = NSNotFound ;
@@ -187,7 +176,6 @@ - (void)reloadData
187176 ctrlRect.size = [labelField frame ].size ;
188177 [labelField setFrame: ctrlRect];
189178 [self addSubview: labelField];
190- [labelField release ];
191179
192180 xCoord += ctrlRect.size .width + SCOPE_BAR_ITEM_SPACING;
193181
@@ -712,7 +700,7 @@ - (NSButton *)buttonForItem:(NSString *)identifier inGroup:(NSInteger)groupNumbe
712700
713701 [self setControl: button forIdentifier: identifier inGroup: groupNumber];
714702
715- return [ button autorelease ] ;
703+ return button;
716704}
717705
718706
@@ -727,7 +715,7 @@ - (NSMenuItem *)menuItemForItem:(NSString *)identifier inGroup:(NSInteger)groupN
727715
728716 [self setControl: menuItem forIdentifier: identifier inGroup: groupNumber];
729717
730- return [ menuItem autorelease ] ;
718+ return menuItem;
731719}
732720
733721
@@ -742,12 +730,10 @@ - (NSPopUpButton *)popupButtonForGroup:(NSDictionary *)group
742730 if (multiSelect) {
743731 MGRecessedPopUpButtonCell *cell = [[MGRecessedPopUpButtonCell alloc ] initTextCell: @" " pullsDown: NO ];
744732 [popup setCell: cell];
745- [cell release ];
746733
747734 [[popup cell ] setUsesItemFromMenu: NO ];
748735 NSMenuItem *titleItem = [[NSMenuItem alloc ] init ];
749736 [[popup cell ] setMenuItem: titleItem];
750- [titleItem release ];
751737 }
752738
753739 // Configure appearance and behaviour.
@@ -782,7 +768,7 @@ - (NSPopUpButton *)popupButtonForGroup:(NSDictionary *)group
782768 popFrame.origin .y = ceil (([self frame ].size .height - popFrame.size .height ) / 2.0 );
783769 [popup setFrame: popFrame];
784770
785- return [ popup autorelease ] ;
771+ return popup;
786772}
787773
788774
@@ -794,7 +780,7 @@ - (void)setControl:(NSObject *)control forIdentifier:(NSString *)identifier inGr
794780
795781 NSMutableArray *identArray = [_identifiers objectForKey: identifier];
796782 if (!identArray) {
797- identArray = [[[ NSMutableArray alloc ] initWithCapacity: groupNumber + 1 ] autorelease ];
783+ identArray = [[NSMutableArray alloc ] initWithCapacity: groupNumber + 1 ];
798784 [_identifiers setObject: identArray forKey: identifier];
799785 }
800786
@@ -872,8 +858,8 @@ - (void)updateMenuTitleForGroupAtIndex:(NSInteger)groupNumber
872858- (void )drawRect : (NSRect )rect
873859{
874860 // Draw gradient background.
875- NSGradient *gradient = [[[ NSGradient alloc ] initWithStartingColor: SCOPE_BAR_START_COLOR_GRAY
876- endingColor: SCOPE_BAR_END_COLOR_GRAY] autorelease ] ;
861+ NSGradient *gradient = [[NSGradient alloc ] initWithStartingColor: SCOPE_BAR_START_COLOR_GRAY
862+ endingColor: SCOPE_BAR_END_COLOR_GRAY];
877863 [gradient drawInRect: [self bounds ] angle: 90.0 ];
878864
879865 // Draw border.
@@ -932,7 +918,6 @@ - (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(NSInt
932918 BOOL informDelegate = YES ;
933919
934920 if (group) {
935- [group retain ];
936921 NSDisableScreenUpdates ();
937922
938923 // We found the group which this item belongs to. Obtain selection-mode and identifiers.
@@ -956,7 +941,6 @@ - (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(NSInt
956941 informDelegate = NO ;
957942 }
958943 }
959- [groupSelections release ];
960944 }
961945
962946 // Change selected state of this item.
@@ -967,7 +951,6 @@ - (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(NSInt
967951 [self updateMenuTitleForGroupAtIndex: groupNumber];
968952 }
969953
970- [group release ];
971954 NSEnableScreenUpdates ();
972955 }
973956 }
@@ -1012,7 +995,7 @@ - (void)updateSelectedState:(BOOL)selected forItem:(NSString *)identifier inGrou
1012995
1013996- (NSArray *)selectedItems
1014997{
1015- return [[ _selectedItems copy ] autorelease ];
998+ return [_selectedItems copy ];
1016999}
10171000- (BOOL ) isItemSelectedWithIdentifier : (NSString *)identifier inGroup : (NSInteger )groupNumber ;
10181001{
0 commit comments