Commits

Brandon Walkin  committed dc8add6

Selectable toolbar - Fixed leaks (thanks Trevor)

  • Participants
  • Parent commits c9c2169

Comments (0)

Files changed (2)

File BWSelectableToolbar.h

 	BOOL inIB;
 	
 	// For the IB inspector
-	NSMutableArray *labels;
 	int selectedIndex;
 	BOOL isPreferencesToolbar;
 }

File BWSelectableToolbar.m

 
 @interface BWSelectableToolbar ()
 @property (retain) BWSelectableToolbarHelper *helper;
-@property (copy) NSMutableArray *labels;
+@property (readonly) NSMutableArray *labels;
 @property (copy) NSMutableDictionary *enabledByIdentifier;
 @property BOOL isPreferencesToolbar;
 @end
 @implementation BWSelectableToolbar
 
 @synthesize helper;
-@synthesize labels;
 @synthesize isPreferencesToolbar;
 @synthesize enabledByIdentifier;
 
 	{		
 		itemIdentifiers = [[NSMutableArray alloc] init];
         itemsByIdentifier = [[NSMutableDictionary alloc] init];
-		labels = [NSMutableArray array];
 		
 		selectedIndex = 0;
 		inIB = YES;
 	[itemIdentifiers release];
 	[itemsByIdentifier release];
 	[enabledByIdentifier release];
-	[labels release];
+	[helper release];
     [super dealloc];
 }
 
 
 - (NSMutableArray *)labels
 {	
-	NSMutableArray *labelArray = [[NSMutableArray alloc] init];
+	NSMutableArray *labelArray = [NSMutableArray array];
 	
 	for (NSToolbarItem *currentItem in [[self editableToolbar] items]) 
 	{
 		}
 	}
 	
-	return [[labelArray retain] autorelease];
+	return labelArray;
 }
 
 - (int)selectedIndex