Commits

Brandon Walkin  committed afb5dce

Toolbar items - modified memory leak fix

  • Participants
  • Parent commits 68aa1c7

Comments (0)

Files changed (2)

File BWToolbarShowColorsItem.m

 
 @implementation BWToolbarShowColorsItem
 
-- (id)initWithItemIdentifier:(NSString *)itemIdentifier
+- (NSImage *)image
 {
-	if (self = [super initWithItemIdentifier:itemIdentifier])
-	{
-		NSBundle *bundle = [NSBundle bundleForClass:[BWToolbarShowColorsItem class]];
-		
-		NSImage *colorsIcon = [[[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"ToolbarItemColors.tiff"]] autorelease];
-		
-		[self setImage:colorsIcon];
-	}
-	return self;
+	NSBundle *bundle = [NSBundle bundleForClass:[BWToolbarShowColorsItem class]];
+	NSImage *image = [[[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"ToolbarItemColors.tiff"]] autorelease];
+	
+	return image;
 }
 
 - (NSString *)itemIdentifier

File BWToolbarShowFontsItem.m

 
 @implementation BWToolbarShowFontsItem
 
-- (id)initWithItemIdentifier:(NSString *)itemIdentifier
+- (NSImage *)image
 {
-	if (self = [super initWithItemIdentifier:itemIdentifier])
-	{
-		NSBundle *bundle = [NSBundle bundleForClass:[BWToolbarShowFontsItem class]];
-		
-		NSImage *fontsIcon = [[[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"ToolbarItemFonts.tiff"]] autorelease];
-		
-		[self setImage:fontsIcon];
-	}
-	return self;
+	NSBundle *bundle = [NSBundle bundleForClass:[BWToolbarShowFontsItem class]];
+	NSImage *image = [[[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"ToolbarItemFonts.tiff"]] autorelease];
+	
+	return image;
 }
 
 - (NSString *)itemIdentifier