Adium

Changeset 24309

Show
Ignore:
Timestamp:
07/13/2008 03:53:44 PM (6 months ago)
Author:
catfish_man
Message:

Fix a memory leak in AIMenuBarIcons. Also move an unrelated autorelease up to the allocation to avoid introducing any leaks like this in the future in this spot. Fixes #10448

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/AIMenuBarIcons.m

    r23583 r24309  
    101101{ 
    102102        NSImage                 *image; 
    103         NSBundle                *menuIconsBundle = [[NSBundle alloc] initWithPath:inPath]; 
     103        NSBundle                *menuIconsBundle = [[[NSBundle alloc] initWithPath:inPath] autorelease]; 
    104104        NSDictionary    *imageInfo; 
    105105         
     
    111111         
    112112        if (!imageInfo) { 
    113                 [menuIconsBundle release]; 
    114113                return nil; 
    115114        } 
    116115 
    117         image = [[NSImage alloc] initWithSize:NSMakeSize((PREVIEW_MENU_IMAGE_SIZE + PREVIEW_MENU_IMAGE_MARGIN) * 2, 
    118                                                                                                          PREVIEW_MENU_IMAGE_SIZE)]; 
     116        image = [[[NSImage alloc] initWithSize:NSMakeSize((PREVIEW_MENU_IMAGE_SIZE + PREVIEW_MENU_IMAGE_MARGIN) * 2, 
     117                                                                                                          PREVIEW_MENU_IMAGE_SIZE)] autorelease]; 
    119118                                                                                                          
    120119 
     
    157156                } 
    158157                [image unlockFocus]; 
    159                 [menuIconsBundle release]; 
    160158        } 
    161159 
    162         return [image autorelease]
     160        return image
    163161} 
    164162