@@ -99,12 +99,6 @@ - (void)dealloc
99
99
[_accessoryView removeFromSuperview ];
100
100
_accessoryView = nil ; // weak ref
101
101
}
102
- [_separatorPositions release ];
103
- [_groups release ];
104
- [_identifiers release ];
105
- [_selectedItems release ];
106
-
107
- [super dealloc ];
108
102
}
109
103
110
104
@@ -124,15 +118,10 @@ - (void)reloadData
124
118
125
119
NSArray *subviews = [[self subviews ] copy ]; // so we don't mutate the collection we're iterating over.
126
120
[subviews makeObjectsPerformSelector: @selector (removeFromSuperview )];
127
- [subviews release ]; // because copies are retained.
128
121
129
- [_separatorPositions release ];
130
122
_separatorPositions = nil ;
131
- [_groups release ];
132
123
_groups = nil ;
133
- [_identifiers release ];
134
124
_identifiers = nil ;
135
- [_selectedItems release ];
136
125
_selectedItems = nil ;
137
126
_firstCollapsedGroup = NSNotFound ;
138
127
_lastWidth = NSNotFound ;
@@ -187,7 +176,6 @@ - (void)reloadData
187
176
ctrlRect.size = [labelField frame ].size ;
188
177
[labelField setFrame: ctrlRect];
189
178
[self addSubview: labelField];
190
- [labelField release ];
191
179
192
180
xCoord += ctrlRect.size .width + SCOPE_BAR_ITEM_SPACING;
193
181
@@ -712,7 +700,7 @@ - (NSButton *)buttonForItem:(NSString *)identifier inGroup:(NSInteger)groupNumbe
712
700
713
701
[self setControl: button forIdentifier: identifier inGroup: groupNumber];
714
702
715
- return [ button autorelease ] ;
703
+ return button;
716
704
}
717
705
718
706
@@ -727,7 +715,7 @@ - (NSMenuItem *)menuItemForItem:(NSString *)identifier inGroup:(NSInteger)groupN
727
715
728
716
[self setControl: menuItem forIdentifier: identifier inGroup: groupNumber];
729
717
730
- return [ menuItem autorelease ] ;
718
+ return menuItem;
731
719
}
732
720
733
721
@@ -742,12 +730,10 @@ - (NSPopUpButton *)popupButtonForGroup:(NSDictionary *)group
742
730
if (multiSelect) {
743
731
MGRecessedPopUpButtonCell *cell = [[MGRecessedPopUpButtonCell alloc ] initTextCell: @" " pullsDown: NO ];
744
732
[popup setCell: cell];
745
- [cell release ];
746
733
747
734
[[popup cell ] setUsesItemFromMenu: NO ];
748
735
NSMenuItem *titleItem = [[NSMenuItem alloc ] init ];
749
736
[[popup cell ] setMenuItem: titleItem];
750
- [titleItem release ];
751
737
}
752
738
753
739
// Configure appearance and behaviour.
@@ -782,7 +768,7 @@ - (NSPopUpButton *)popupButtonForGroup:(NSDictionary *)group
782
768
popFrame.origin .y = ceil (([self frame ].size .height - popFrame.size .height ) / 2.0 );
783
769
[popup setFrame: popFrame];
784
770
785
- return [ popup autorelease ] ;
771
+ return popup;
786
772
}
787
773
788
774
@@ -794,7 +780,7 @@ - (void)setControl:(NSObject *)control forIdentifier:(NSString *)identifier inGr
794
780
795
781
NSMutableArray *identArray = [_identifiers objectForKey: identifier];
796
782
if (!identArray) {
797
- identArray = [[[ NSMutableArray alloc ] initWithCapacity: groupNumber + 1 ] autorelease ];
783
+ identArray = [[NSMutableArray alloc ] initWithCapacity: groupNumber + 1 ];
798
784
[_identifiers setObject: identArray forKey: identifier];
799
785
}
800
786
@@ -872,8 +858,8 @@ - (void)updateMenuTitleForGroupAtIndex:(NSInteger)groupNumber
872
858
- (void )drawRect : (NSRect )rect
873
859
{
874
860
// 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];
877
863
[gradient drawInRect: [self bounds ] angle: 90.0 ];
878
864
879
865
// Draw border.
@@ -932,7 +918,6 @@ - (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(NSInt
932
918
BOOL informDelegate = YES ;
933
919
934
920
if (group) {
935
- [group retain ];
936
921
NSDisableScreenUpdates ();
937
922
938
923
// 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
956
941
informDelegate = NO ;
957
942
}
958
943
}
959
- [groupSelections release ];
960
944
}
961
945
962
946
// Change selected state of this item.
@@ -967,7 +951,6 @@ - (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(NSInt
967
951
[self updateMenuTitleForGroupAtIndex: groupNumber];
968
952
}
969
953
970
- [group release ];
971
954
NSEnableScreenUpdates ();
972
955
}
973
956
}
@@ -1012,7 +995,7 @@ - (void)updateSelectedState:(BOOL)selected forItem:(NSString *)identifier inGrou
1012
995
1013
996
- (NSArray *)selectedItems
1014
997
{
1015
- return [[ _selectedItems copy ] autorelease ];
998
+ return [_selectedItems copy ];
1016
999
}
1017
1000
- (BOOL ) isItemSelectedWithIdentifier : (NSString *)identifier inGroup : (NSInteger )groupNumber ;
1018
1001
{
0 commit comments