Changeset 13251


Ignore:
Timestamp:
Mar 13, 2012, 2:52:11 AM (9 years ago)
Author:
livings124
Message:

reverse r13248-r13250, since ARC doesn't support 32-bit.

Location:
trunk
Files:
71 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r13248 r13251  
    241241                A29E653613F1603100048D71 /* evutil_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = A29E653513F1603100048D71 /* evutil_rand.c */; };
    242242                A2A1CB7A0BF29D5500AE959F /* PeerProgressIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */; };
    243                 A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306540AAD24A80049E2AC /* UKFileWatcher.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
    244                 A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
    245                 A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306580AAD24A80049E2AC /* UKKQueue.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
    246                 A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
     243                A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306540AAD24A80049E2AC /* UKFileWatcher.m */; };
     244                A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */; };
     245                A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306580AAD24A80049E2AC /* UKKQueue.m */; };
     246                A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */; };
    247247                A2A4E9210DE0F7E9000CE197 /* web.h in Headers */ = {isa = PBXBuildFile; fileRef = A29EBE530DC01FC9006CEE80 /* web.h */; };
    248248                A2A4E9220DE0F7EB000CE197 /* web.c in Sources */ = {isa = PBXBuildFile; fileRef = A29EBE520DC01FC9006CEE80 /* web.c */; };
     
    11641164                                A2ED7D8D0CEF431B00970975 /* FilterButton.h */,
    11651165                                A2ED7D8E0CEF431B00970975 /* FilterButton.m */,
     1166                                A2C89D5F0CFCBF57004CC2BC /* ButtonToolbarItem.m */,
    11661167                                A28E1DDF0CFFD8EC00E16385 /* ButtonToolbarItem.h */,
    1167                                 A2C89D5F0CFCBF57004CC2BC /* ButtonToolbarItem.m */,
    11681168                                A21979890D07B78400438EA7 /* GroupToolbarItem.h */,
    11691169                                A219798A0D07B78400438EA7 /* GroupToolbarItem.m */,
     
    27312731                        isa = XCBuildConfiguration;
    27322732                        buildSettings = {
    2733                                 CLANG_ENABLE_OBJC_ARC = YES;
    27342733                                FRAMEWORK_SEARCH_PATHS = macosx;
    27352734                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
     
    28902889                        isa = XCBuildConfiguration;
    28912890                        buildSettings = {
    2892                                 CLANG_ENABLE_OBJC_ARC = YES;
    28932891                                FRAMEWORK_SEARCH_PATHS = macosx;
    28942892                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
     
    30002998                        isa = XCBuildConfiguration;
    30012999                        buildSettings = {
    3002                                 CLANG_ENABLE_OBJC_ARC = YES;
    30033000                                FRAMEWORK_SEARCH_PATHS = macosx;
    30043001                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
  • trunk/macosx/AboutWindowController.m

    r13248 r13251  
    4444                                        value: nil table: @"InfoPlist"]];
    4545   
    46     [[fTextView textStorage] setAttributedString: [[NSAttributedString alloc] initWithPath:
    47             [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil]];
     46    [[fTextView textStorage] setAttributedString: [[[NSAttributedString alloc] initWithPath:
     47            [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]];
    4848   
    4949    //size license button
     
    6666- (void) windowWillClose: (id) sender
    6767{
     68        [fAboutBoxInstance autorelease];
    6869    fAboutBoxInstance = nil;
    6970}
  • trunk/macosx/AddMagnetWindowController.h

    r13248 r13251  
    3535    IBOutlet NSPopUpButton * fGroupPopUp, * fPriorityPopUp;
    3636   
    37     __unsafe_unretained Controller * fController;
     37    Controller * fController;
    3838   
    3939    Torrent * fTorrent;
  • trunk/macosx/AddMagnetWindowController.m

    r13248 r13251  
    5454    {
    5555        fTorrent = torrent;
    56         fDestination = [path stringByExpandingTildeInPath];
     56        fDestination = [[path stringByExpandingTildeInPath] retain];
    5757       
    5858        fController = controller;
     
    107107{
    108108    [[NSNotificationCenter defaultCenter] removeObserver: self];
     109   
     110    [fDestination release];
     111   
     112    [super dealloc];
    109113}
    110114
     
    215219    if (!fDestination || ![fDestination isEqualToString: destination])
    216220    {
    217         fDestination = destination;
     221        [fDestination release];
     222        fDestination = [destination retain];
    218223       
    219224        [fTorrent changeDownloadFolderBeforeUsing: fDestination];
     
    225230    ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
    226231    [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]];
     232    [iconTransformer release];
    227233}
    228234
     
    250256        [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"];
    251257   
     258    [alert release];
    252259   
    253260    if (returnCode == NSAlertSecondButtonReturn)
  • trunk/macosx/AddWindowController.h

    r13248 r13251  
    3939    IBOutlet FileOutlineController * fFileController;
    4040   
    41     __unsafe_unretained Controller * fController;
     41    Controller * fController;
    4242   
    4343    Torrent * fTorrent;
  • trunk/macosx/AddWindowController.m

    r13248 r13251  
    6161    {
    6262        fTorrent = torrent;
    63         fDestination = [path stringByExpandingTildeInPath];
     63        fDestination = [[path stringByExpandingTildeInPath] retain];
    6464        fLockDestination = lockDestination;
    6565       
    6666        fController = controller;
    6767       
    68         fTorrentFile = [torrentFile stringByExpandingTildeInPath];
     68        fTorrentFile = [[torrentFile stringByExpandingTildeInPath] retain];
    6969       
    7070        fDeleteTorrentInitial = deleteTorrent;
     
    140140   
    141141    [fTimer invalidate];
     142   
     143    [fDestination release];
     144    [fTorrentFile release];
     145   
     146    [super dealloc];
    142147}
    143148
     
    312317    if (!fDestination || ![fDestination isEqualToString: destination])
    313318    {
    314         fDestination = destination;
     319        [fDestination release];
     320        fDestination = [destination retain];
    315321       
    316322        [fTorrent changeDownloadFolderBeforeUsing: fDestination];
     
    322328    ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
    323329    [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]];
     330    [iconTransformer release];
    324331}
    325332
     
    350357        [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"];
    351358   
     359    [alert release];
    352360   
    353361    if (returnCode == NSAlertSecondButtonReturn)
  • trunk/macosx/BadgeView.m

    r13248 r13251  
    4949}
    5050
     51- (void) dealloc
     52{
     53    [fAttributes release];
     54    [super dealloc];
     55}
    5156
    5257- (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate
     
    109114        [fAttributes setObject: stringShadow forKey: NSShadowAttributeName];
    110115       
     116        [stringShadow release];
    111117    }
    112118   
  • trunk/macosx/Badger.m

    r13248 r13251  
    3838        BadgeView * view = [[BadgeView alloc] initWithLib: lib];
    3939        [[NSApp dockTile] setContentView: view];
     40        [view release];
    4041       
    4142        fHashes = [[NSMutableSet alloc] init];
     
    4849{
    4950    [[NSNotificationCenter defaultCenter] removeObserver: self];
     51   
     52    [fHashes release];
     53   
     54    [super dealloc];
    5055}
    5156
  • trunk/macosx/BlocklistDownloader.h

    r13248 r13251  
    3838    NSURLDownload * fDownload;
    3939   
    40     __unsafe_unretained BlocklistDownloaderViewController * fViewController;
     40    BlocklistDownloaderViewController * fViewController;
    4141   
    4242    NSString * fDestination;
  • trunk/macosx/BlocklistDownloader.m

    r13250 r13251  
    3232- (void) startDownload;
    3333- (void) decompressBlocklist;
     34- (void) finishDownloadSuccess;
    3435
    3536@end
     
    3738@implementation BlocklistDownloader
    3839
    39 BlocklistDownloader * fBLDownloader = nil;
     40BlocklistDownloader * fDownloader = nil;
    4041+ (BlocklistDownloader *) downloader
    4142{
    42     if (!fBLDownloader)
     43    if (!fDownloader)
    4344    {
    44         fBLDownloader = [[BlocklistDownloader alloc] init];
    45         [fBLDownloader startDownload];
     45        fDownloader = [[BlocklistDownloader alloc] init];
     46        [fDownloader startDownload];
    4647    }
    4748   
    48     return fBLDownloader;
     49    return fDownloader;
    4950}
    5051
    5152+ (BOOL) isRunning
    5253{
    53     return fBLDownloader != nil;
     54    return fDownloader != nil;
    5455}
    5556
     
    7475}
    7576
     77- (void) dealloc
     78{
     79    [fDownload release];
     80    [fDestination release];
     81    [super dealloc];
     82}
    7683
    7784- (void) cancelDownload
     
    8390    [[BlocklistScheduler scheduler] updateSchedule];
    8491   
    85     fBLDownloader = nil;
     92    fDownloader = nil;
     93    [self release];
    8694}
    8795
     
    94102- (void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path
    95103{
    96     fDestination = path;
     104    [fDestination release];
     105    fDestination = [path retain];
    97106}
    98107
     
    120129    [[BlocklistScheduler scheduler] updateSchedule];
    121130   
    122     fBLDownloader = nil;
     131    fDownloader = nil;
     132    [self release];
    123133}
    124134
     
    126136{
    127137    fState = BLOCKLIST_DL_PROCESSING;
    128    
    129     [fViewController setStatusProcessing];
    130    
    131     //process data
    132     NSAssert(fDestination != nil, @"the blocklist file destination has not been specified");
    133    
    134     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    135         [self decompressBlocklist];
    136        
    137         dispatch_async(dispatch_get_main_queue(), ^{
    138             const int count = tr_blocklistSetContent([PrefsController handle], [fDestination UTF8String]);
    139            
    140             //delete downloaded file
    141             [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL];
    142            
    143             if (count > 0)
    144                 [fViewController setFinished];
    145             else
    146                 [fViewController setFailed: NSLocalizedString(@"The specified blocklist file did not contain any valid rules.",
    147                                                               "blocklist fail message")];
    148            
    149             //update last updated date for schedule
    150             NSDate * date = [NSDate date];
    151             [[NSUserDefaults standardUserDefaults] setObject: date forKey: @"BlocklistNewLastUpdate"];
    152             [[NSUserDefaults standardUserDefaults] setObject: date forKey: @"BlocklistNewLastUpdateSuccess"];
    153             [[BlocklistScheduler scheduler] updateSchedule];
    154            
    155             [[NSNotificationCenter defaultCenter] postNotificationName: @"BlocklistUpdated" object: nil];
    156            
    157             fBLDownloader = nil;
    158         });
    159     });
     138    [self performSelectorInBackground: @selector(finishDownloadSuccess) withObject: nil];
    160139}
    161140
     
    217196                        success = NO;
    218197                }
     198                [unzip release];
    219199               
    220200                if (success) {
     
    237217                                [zipinfo waitUntilExit];
    238218                               
    239                                 NSString * actualFilename = [[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile]
    240                                                 encoding: NSUTF8StringEncoding];
     219                                NSString * actualFilename = [[[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile]
     220                                                encoding: NSUTF8StringEncoding] autorelease];
    241221                                actualFilename = [actualFilename stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
    242222                                NSString * newBlocklistPath = [workingDirectory stringByAppendingPathComponent: actualFilename];
     
    245225                                [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL];
    246226               
    247                 fDestination = newBlocklistPath;
     227                [fDestination release];
     228                fDestination = [newBlocklistPath retain];
    248229                        }
    249230            @catch(id exc) {}
     231                        [zipinfo release];
    250232                }               
    251233        }
    252234}
    253235
     236
     237- (void) finishDownloadSuccess
     238{
     239    @autoreleasepool
     240    {
     241        [fViewController setStatusProcessing];
     242       
     243        //process data
     244        NSAssert(fDestination != nil, @"the blocklist file destination has not been specified");
     245       
     246        [self decompressBlocklist];
     247       
     248        const int count = tr_blocklistSetContent([PrefsController handle], [fDestination UTF8String]);
     249       
     250        //delete downloaded file
     251        [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL];
     252       
     253        if (count > 0)
     254            [fViewController setFinished];
     255        else
     256            [fViewController setFailed: NSLocalizedString(@"The specified blocklist file did not contain any valid rules.",
     257                                            "blocklist fail message")];
     258       
     259        //update last updated date for schedule
     260        NSDate * date = [NSDate date];
     261        [[NSUserDefaults standardUserDefaults] setObject: date forKey: @"BlocklistNewLastUpdate"];
     262        [[NSUserDefaults standardUserDefaults] setObject: date forKey: @"BlocklistNewLastUpdateSuccess"];
     263        [[BlocklistScheduler scheduler] updateSchedule];
     264       
     265        [[NSNotificationCenter defaultCenter] postNotificationName: @"BlocklistUpdated" object: nil];
     266    }
     267   
     268    fDownloader = nil;
     269    [self release];
     270}
     271
    254272@end
  • trunk/macosx/BlocklistDownloaderViewController.h

    r13248 r13251  
    3030@interface BlocklistDownloaderViewController : NSObject
    3131{   
    32     __unsafe_unretained PrefsController * fPrefsController;
     32    PrefsController * fPrefsController;
    3333   
    3434    IBOutlet NSWindow * fStatusWindow;
  • trunk/macosx/BlocklistDownloaderViewController.m

    r13250 r13251  
    3838@implementation BlocklistDownloaderViewController
    3939
    40 BlocklistDownloaderViewController * fBLViewController = nil;
    4140+ (void) downloadWithPrefsController: (PrefsController *) prefsController
    4241{
    43     if (!fBLViewController)
    44     {
    45         fBLViewController = [[BlocklistDownloaderViewController alloc] initWithPrefsController: prefsController];
    46         [fBLViewController startDownload];
    47     }
     42    BlocklistDownloaderViewController * downloader = [[BlocklistDownloaderViewController alloc] initWithPrefsController: prefsController];
     43    [downloader startDownload];
    4844}
    4945
     
    106102    [fStatusWindow orderOut: self];
    107103   
    108     fBLViewController = nil;
     104    [self release];
    109105}
    110106
     
    114110    [fStatusWindow orderOut: self];
    115111   
    116     NSAlert * alert = [[NSAlert alloc] init];
     112    NSAlert * alert = [[[NSAlert alloc] init] autorelease];
    117113    [alert addButtonWithTitle: NSLocalizedString(@"OK", "Blocklist -> button")];
    118114    [alert setMessageText: NSLocalizedString(@"Download of the blocklist failed.", "Blocklist -> message")];
     
    153149{
    154150    [[alert window] orderOut: self];
    155    
    156     fBLViewController = nil;
     151    [self release];
    157152}
    158153
  • trunk/macosx/BonjourController.m

    r13249 r13251  
    3030+ (BonjourController *) defaultController
    3131{
    32     static dispatch_once_t onceToken;
    33     dispatch_once(&onceToken, ^{
     32    if (!fDefaultController)
    3433        fDefaultController = [[BonjourController alloc] init];
    35     });
    36    
    3734    return fDefaultController;
    3835}
    3936
     37- (void) dealloc
     38{
     39    [fService release];
     40    [super dealloc];
     41}
    4042
    4143- (void) startWithPort: (NSInteger) port
     
    5456{
    5557    [fService stop];
     58    [fService release];
    5659    fService = nil;
    5760}
  • trunk/macosx/ButtonToolbarItem.h

    r13248 r13251  
    2626
    2727@interface ButtonToolbarItem : NSToolbarItem
     28{
     29}
    2830
    2931@end
  • trunk/macosx/ButtonToolbarItem.m

    r13248 r13251  
    3838    [menuItem setEnabled: [[self target] validateToolbarItem: self]];
    3939   
    40     return menuItem;
     40    return [menuItem autorelease];
    4141}
    4242
  • trunk/macosx/Controller.h

    r13248 r13251  
    107107    NSMutableSet                    * fAddingTransfers;
    108108   
    109     NSMutableSet                    * fAddWindows;
    110     URLSheetWindowController        * fUrlSheetController;
    111    
    112109    BOOL                            fGlobalPopoverShown;
    113110    BOOL                            fSoundPlaying;
     
    131128- (void) openURL: (NSString *) urlString;
    132129- (void) openURLShowSheet: (id) sender;
     130- (void) urlSheetDidEnd: (URLSheetWindowController *) controller url: (NSString *) urlString returnCode: (NSInteger) returnCode;
    133131
    134132- (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo;
  • trunk/macosx/Controller.m

    r13248 r13251  
    140140    NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [[NSNumber alloc] initWithBool: active], @"Active",
    141141                                [[NSNumber alloc] initWithBool: byUser], @"ByUser", nil];
    142     [(__bridge Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
     142    [(Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
    143143        withObject: dict waitUntilDone: NO];
    144144}
     
    147147                                            void * controller)
    148148{
    149     [(__bridge Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
     149    [(Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
    150150    return TR_RPC_NOREMOVE; //we'll do the remove manually
    151151}
     
    153153static void sleepCallback(void * controller, io_service_t y, natural_t messageType, void * messageArgument)
    154154{
    155     [(__bridge Controller *)controller sleepCallback: messageType argument: messageArgument];
     155    [(Controller *)controller sleepCallback: messageType argument: messageArgument];
    156156}
    157157
     
    173173       
    174174        [alert runModal];
     175        [alert release];
    175176       
    176177        //kill ourselves right away
     
    182183   
    183184    //set custom value transformers
    184     ExpandedPathToPathTransformer * pathTransformer = [[ExpandedPathToPathTransformer alloc] init];
     185    ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease];
    185186    [NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"];
    186187   
    187     ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
     188    ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease];
    188189    [NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"];
    189190   
     
    203204        if ([alert runModal] == NSAlertSecondButtonReturn)
    204205            exit(0);
     206        [alert release];
    205207       
    206208        [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningLegal"];
     
    341343        fSoundPlaying = NO;
    342344       
    343         tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, (__bridge void *)(self));
     345        tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self);
    344346        if (usesSpeedLimitSched)
    345347            [fDefaults setBool: tr_sessionUsesAltSpeed(fLib) forKey: @"SpeedLimit"];
    346348       
    347         tr_sessionSetRPCCallback(fLib, rpcCallback, (__bridge void *)(self));
     349        tr_sessionSetRPCCallback(fLib, rpcCallback, self);
    348350       
    349351        [GrowlApplicationBridge setGrowlDelegate: self];
     
    367369    [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly];
    368370    [fWindow setToolbar: toolbar];
     371    [toolbar release];
    369372   
    370373    [fWindow setDelegate: self]; //do manually to avoid placement issue
     
    436439    IONotificationPortRef notify;
    437440    io_object_t iterator;
    438     if ((fRootPort = IORegisterForSystemPower((__bridge void *)(self), & notify, sleepCallback, &iterator)))
     441    if ((fRootPort = IORegisterForSystemPower(self, & notify, sleepCallback, &iterator)))
    439442        CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes);
    440443    else
     
    466469                    [waitToStartTorrents addObject: torrent];
    467470               
     471                [torrent release];
    468472            }
    469473        }
     
    596600                [fDefaults setBool: ([[alert suppressionButton] state] != NSOnState) forKey: @"WarningDonate"];
    597601           
     602            [alert release];
    598603        }
    599604    }
     
    666671        if ([fAutoImportTimer isValid])
    667672            [fAutoImportTimer invalidate];
     673        [fAutoImportTimer release];
    668674    }
    669675   
     
    677683            NSURLDownload * download = [downloadDict objectForKey: @"Download"];
    678684            [download cancel];
    679         }
     685            [download release];
     686        }
     687        [fPendingTorrentDownloads release];
    680688    }
    681689   
     
    696704    [fTableView saveCollapsedGroups];
    697705   
     706    //remaining calls the same as dealloc
     707    [fInfoController release];
     708    [fMessageController release];
     709    [fPrefsController release];
     710   
     711    [fStatusBar release];
     712    [fFilterBar release];
     713   
     714    [fTorrents release];
     715    [fDisplayedTorrents release];
     716   
     717    [fAddingTransfers release];
     718   
     719    [fOverlayWindow release];
     720    [fBadger release];
     721   
     722    [fAutoImportedNames release];
     723   
     724    [fPreviewPanel release];
     725   
    698726    //complete cleanup
    699727    tr_sessionClose(fLib);
     
    723751    {
    724752        [download cancel];
    725        
    726         [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
    727         if ([fPendingTorrentDownloads count] == 0)
    728             fPendingTorrentDownloads = nil;
    729753       
    730754        NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Download not a torrent -> title"),
     
    733757            [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]],
    734758            NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil);
     759       
     760        [download release];
    735761    }
    736762    else
     
    741767-(void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path
    742768{
    743     [(NSMutableDictionary *)[fPendingTorrentDownloads objectForKey: [[download request] URL]] setObject: path forKey: @"Path"];
     769    if (!fPendingTorrentDownloads)
     770        fPendingTorrentDownloads = [[NSMutableDictionary alloc] init];
     771   
     772    [fPendingTorrentDownloads setObject: [NSDictionary dictionaryWithObjectsAndKeys:
     773                    path, @"Path", download, @"Download", nil] forKey: [[download request] URL]];
    744774}
    745775
     
    754784    [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
    755785    if ([fPendingTorrentDownloads count] == 0)
     786    {
     787        [fPendingTorrentDownloads release];
    756788        fPendingTorrentDownloads = nil;
     789    }
     790   
     791    [download release];
    757792}
    758793
     
    768803    [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
    769804    if ([fPendingTorrentDownloads count] == 0)
     805    {
     806        [fPendingTorrentDownloads release];
    770807        fPendingTorrentDownloads = nil;
     808    }
     809   
     810    [download release];
    771811}
    772812
     
    862902                                                    deleteTorrent: deleteTorrentFile canToggleDelete: canToggleDelete];
    863903            [addController showWindow: self];
    864            
    865             if (!fAddWindows)
    866                 fAddWindows = [NSMutableSet set];
    867             [fAddWindows addObject: addController];
    868904        }
    869905        else
     
    874910            [torrent update];
    875911            [fTorrents addObject: torrent];
     912            [torrent release];
    876913           
    877914            if (!fAddingTransfers)
     
    887924{
    888925    Torrent * torrent = [addController torrent];
     926    [addController autorelease];
    889927   
    890928    if (add)
     
    894932        [torrent update];
    895933        [fTorrents addObject: torrent];
     934        [torrent release];
    896935       
    897936        if (!fAddingTransfers)
     
    904943    {
    905944        [torrent closeRemoveTorrent: NO];
    906     }
    907    
    908     [fAddWindows removeObject: addController];
    909     if ([fAddWindows count] == 0)
    910         fAddWindows = nil;
     945        [torrent release];
     946    }
    911947}
    912948
     
    946982                                                        controller: self];
    947983        [addController showWindow: self];
    948        
    949         if (!fAddWindows)
    950             fAddWindows = [NSMutableSet set];
    951         [fAddWindows addObject: addController];
    952984    }
    953985    else
     
    958990        [torrent update];
    959991        [fTorrents addObject: torrent];
     992        [torrent release];
    960993       
    961994        if (!fAddingTransfers)
     
    9701003{
    9711004    Torrent * torrent = [addController torrent];
     1005    [addController autorelease];
    9721006   
    9731007    if (add)
     
    9771011        [torrent update];
    9781012        [fTorrents addObject: torrent];
     1013        [torrent release];
    9791014       
    9801015        if (!fAddingTransfers)
     
    9871022    {
    9881023        [torrent closeRemoveTorrent: NO];
    989     }
    990    
    991     [fAddWindows removeObject: addController];
    992     if ([fAddWindows count] == 0)
    993         fAddWindows = nil;
     1024        [torrent release];
     1025    }
    9941026}
    9951027
     
    9971029{
    9981030    NSDictionary * dict = [notification userInfo];
    999     [self openFiles: [NSArray arrayWithObject: [dict objectForKey: @"File"]] addType: ADD_CREATED forcePath: [dict objectForKey: @"Path"]];
     1031    [self openFiles: [NSArray arrayWithObject: [dict objectForKey: @"File"]] addType: ADD_CREATED
     1032                        forcePath: [dict objectForKey: @"Path"]];
     1033    [dict release];
    10001034}
    10011035
     
    10031037{
    10041038    [self openFiles: [dictionary objectForKey: @"Filenames"] addType: [[dictionary objectForKey: @"AddType"] intValue] forcePath: nil];
     1039   
     1040    [dictionary release];
    10051041}
    10061042
     
    10541090    if ([[alert suppressionButton] state] == NSOnState)
    10551091        [fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
     1092    [alert release];
    10561093}
    10571094
     
    10711108    if ([[alert suppressionButton] state] == NSOnState)
    10721109        [fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
     1110    [alert release];
    10731111}
    10741112
     
    10911129    if ([[alert suppressionButton] state])
    10921130        [fDefaults setBool: NO forKey: @"WarningDuplicate"];
     1131    [alert release];
    10931132}
    10941133
     
    11151154    if ([[alert suppressionButton] state])
    11161155        [fDefaults setBool: NO forKey: @"WarningDuplicate"];
     1156    [alert release];
    11171157}
    11181158
     
    11411181        NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: urlString]
    11421182                                    cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 60];
    1143        
    1144         if ([fPendingTorrentDownloads objectForKey: [request URL]])
    1145         {
    1146             NSLog(@"Already downloading %@", [request URL]);
    1147             return;
    1148         }
    1149        
    1150         NSURLDownload * download = [[NSURLDownload alloc] initWithRequest: request delegate: self];
    1151        
    1152         if (!fPendingTorrentDownloads)
    1153             fPendingTorrentDownloads = [[NSMutableDictionary alloc] init];
    1154        
    1155         [fPendingTorrentDownloads setObject: [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"] forKey: [request URL]];
     1183        [[NSURLDownload alloc] initWithRequest: request delegate: self];
    11561184    }
    11571185}
     
    11591187- (void) openURLShowSheet: (id) sender
    11601188{
    1161     if (!fUrlSheetController)
    1162     {
    1163         fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self];
    1164        
    1165         [NSApp beginSheet: [fUrlSheetController window] modalForWindow: fWindow modalDelegate: self didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil];
    1166     }
    1167 }
    1168 
    1169 - (void) urlSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
     1189    [[[URLSheetWindowController alloc] initWithController: self] beginSheetForWindow: fWindow];
     1190}
     1191
     1192- (void) urlSheetDidEnd: (URLSheetWindowController *) controller url: (NSString *) urlString returnCode: (NSInteger) returnCode
    11701193{
    11711194    if (returnCode == 1)
    1172     {
    1173         NSString * urlString = [fUrlSheetController urlString];
    11741195        [self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO];
    1175     }
    1176    
    1177     fUrlSheetController = nil;
     1196   
     1197    [controller release];
    11781198}
    11791199
     
    12571277- (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData
    12581278{
     1279    [torrents retain];
    12591280
    12601281    if ([fDefaults boolForKey: @"CheckRemove"])
     
    13191340            NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"),
    13201341                NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self,
    1321                 nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), (__bridge void *)dict, message);
     1342                nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), dict, message);
    13221343            return;
    13231344        }
     
    13321353    if (returnCode == NSAlertDefaultReturn)
    13331354        [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]];
     1355    else
     1356        [torrents release];
     1357   
     1358    [dict release];
    13341359}
    13351360
     
    14191444   
    14201445    [self fullUpdateUI];
     1446   
     1447    #warning why do we need them retained?
     1448    [torrents autorelease];
    14211449}
    14221450
     
    14601488        }
    14611489       
    1462         NSAlert * alert = [[NSAlert alloc] init];
     1490        NSAlert * alert = [[[NSAlert alloc] init] autorelease];
    14631491        [alert setMessageText: message];
    14641492        [alert setInformativeText: info];
     
    14741502        if (returnCode != NSAlertFirstButtonReturn)
    14751503        {
     1504            [torrents release];
    14761505            return;
    14771506        }
     
    15211550    if ([torrents count] == 0)
    15221551    {
     1552        [torrents release];
    15231553        return;
    15241554    }
     
    15571587           
    15581588            [alert runModal];
     1589            [alert release];
    15591590        }
    15601591       
     
    22702301                        if (!newGroup)
    22712302                        {
    2272                             newGroup = [[TorrentGroup alloc] initWithGroup: groupValue];
     2303                            newGroup = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
    22732304                            [groupsByIndex setObject: newGroup forKey: [NSNumber numberWithInteger: groupValue]];
    22742305                            [fDisplayedTorrents addObject: newGroup];
     
    23162347            if (!group)
    23172348            {
    2318                 group = [[TorrentGroup alloc] initWithGroup: groupValue];
     2349                group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
    23192350                [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]];
    23202351                [fDisplayedTorrents addObject: group];
     
    23792410                if (!group)
    23802411                {
    2381                     group = [[TorrentGroup alloc] initWithGroup: groupValue];
     2412                    group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
    23822413                    [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]];
    23832414                }
     
    24472478    if (fAddingTransfers)
    24482479    {
     2480        [fAddingTransfers release];
    24492481        fAddingTransfers = nil;
    24502482    }
     
    24712503        [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
    24722504       
     2505        [viewController release];
     2506        [popover release];
    24732507    }
    24742508    else
     
    25062540        for (NSInteger i = 0; i < groupMenuCount; i++)
    25072541        {
    2508             NSMenuItem * item = [groupMenu itemAtIndex: 0];
     2542            NSMenuItem * item = [[groupMenu itemAtIndex: 0] retain];
    25092543            [groupMenu removeItemAtIndex: 0];
    25102544            [menu addItem: item];
     2545            [item release];
    25112546        }
    25122547    }
     
    25272562            [item setRepresentedObject: [NSNumber numberWithInt: speedLimitActionValue[i]]];
    25282563            [menu addItem: item];
     2564            [item release];
    25292565        }
    25302566    }
     
    25442580            [item setRepresentedObject: [NSNumber numberWithFloat: ratioLimitActionValue[i]]];
    25452581            [menu addItem: item];
     2582            [item release];
    25462583        }
    25472584    }
     
    25902627            notificationName: GROWL_AUTO_SPEED_LIMIT iconData: nil priority: 0 isSticky: NO clickContext: nil];
    25912628   
     2629    [dict release];
    25922630}
    25932631
     
    26412679            if ([fAutoImportTimer isValid])
    26422680                [fAutoImportTimer invalidate];
     2681            [fAutoImportTimer release];
    26432682            fAutoImportTimer = nil;
    26442683        }
    26452684       
    26462685        //check again in 10 seconds in case torrent file wasn't complete
    2647         fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0 target: self
    2648             selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO];
     2686        fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self
     2687            selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain];
    26492688       
    26502689        [self checkAutoImportDirectory];
     
    26582697        if ([fAutoImportTimer isValid])
    26592698            [fAutoImportTimer invalidate];
     2699        [fAutoImportTimer release];
    26602700        fAutoImportTimer = nil;
    26612701    }
    26622702   
    2663     fAutoImportedNames = nil;
     2703    if (fAutoImportedNames)
     2704    {
     2705        [fAutoImportedNames release];
     2706        fAutoImportedNames = nil;
     2707    }
    26642708   
    26652709    [self checkAutoImportDirectory];
     
    27222766    }
    27232767   
     2768    [newNames release];
    27242769}
    27252770
     
    32593304    {
    32603305        [[fStatusBar view] removeFromSuperviewWithoutNeedingDisplay];
     3306        [fStatusBar release];
    32613307        fStatusBar = nil;
    32623308    }
     
    33563402    {
    33573403        [[fFilterBar view] removeFromSuperviewWithoutNeedingDisplay];
     3404        [fFilterBar release];
    33583405        fFilterBar = nil;
    33593406    }
     
    33843431- (void) beginPreviewPanelControl: (QLPreviewPanel *) panel
    33853432{
    3386     fPreviewPanel = panel;
     3433    fPreviewPanel = [panel retain];
    33873434    [fPreviewPanel setDelegate: self];
    33883435    [fPreviewPanel setDataSource: self];
     
    33913438- (void) endPreviewPanelControl: (QLPreviewPanel *) panel
    33923439{
     3440    [fPreviewPanel release];
    33933441    fPreviewPanel = nil;
    33943442}
     
    34673515   
    34683516    [item setView: button];
     3517    [button release];
    34693518   
    34703519    const NSSize buttonSize = NSMakeSize(36.0, 25.0);
     
    34723521    [item setMaxSize: buttonSize];
    34733522   
    3474     return item;
     3523    return [item autorelease];
    34753524}
    34763525
     
    35523601       
    35533602        NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
    3554         [segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]];
     3603        [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
    35553604        [groupItem setView: segmentedControl];
    35563605        NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
     
    35833632                                        NSLocalizedString(@"Resume All", "All toolbar item -> label"), nil]];
    35843633       
     3634        [segmentedControl release];
    35853635       
    35863636        [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
    35873637       
    3588         return groupItem;
     3638        return [groupItem autorelease];
    35893639    }
    35903640    else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_SELECTED])
     
    35933643       
    35943644        NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
    3595         [segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]];
     3645        [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
    35963646        [groupItem setView: segmentedControl];
    35973647        NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
     
    36243674                                        NSLocalizedString(@"Resume Selected", "Selected toolbar item -> label"), nil]];
    36253675       
     3676        [segmentedControl release];
    36263677       
    36273678        [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
    36283679       
    3629         return groupItem;
     3680        return [groupItem autorelease];
    36303681    }
    36313682    else if ([ident isEqualToString: TOOLBAR_FILTER])
     
    42254276    [menu addItemWithTitle: NSLocalizedString(@"Speed Limit", "Dock item") action: @selector(toggleSpeedLimit:) keyEquivalent: @""];
    42264277   
    4227     return menu;
     4278    return [menu autorelease];
    42284279}
    42294280
     
    43884439                if (torrentStruct == [torrent torrentStruct])
    43894440                {
     4441                    [torrent retain];
    43904442                    break;
    43914443                }
     
    44024454            case TR_RPC_TORRENT_ADDED:
    44034455                [self performSelectorOnMainThread: @selector(rpcAddTorrentStruct:) withObject:
    4404                     [NSValue valueWithPointer: torrentStruct] waitUntilDone: NO];
     4456                    [[NSValue valueWithPointer: torrentStruct] retain] waitUntilDone: NO];
    44054457                break;
    44064458           
     
    44414493            default:
    44424494                NSAssert1(NO, @"Unknown RPC command received: %d", type);
     4495                [torrent release];
    44434496        }
    44444497    }
     
    44484501{
    44494502    tr_torrent * torrentStruct = (tr_torrent *)[torrentStructPtr pointerValue];
     4503    [torrentStructPtr release];
    44504504   
    44514505    NSString * location = nil;
     
    44644518    [torrent update];
    44654519    [fTorrents addObject: torrent];
     4520    [torrent release];
    44664521   
    44674522    if (!fAddingTransfers)
     
    44744529- (void) rpcRemoveTorrent: (Torrent *) torrent
    44754530{
    4476     [self confirmRemoveTorrents: [NSArray arrayWithObject: torrent] deleteData: NO];
     4531    [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO];
     4532    [torrent release];
    44774533}
    44784534
    44794535- (void) rpcRemoveTorrentDeleteData: (Torrent *) torrent
    44804536{
    4481     [self confirmRemoveTorrents: [NSArray arrayWithObject: torrent] deleteData: YES];
     4537    [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: YES];
     4538    [torrent release];
    44824539}
    44834540
     
    44854542{
    44864543    [torrent update];
     4544    [torrent release];
    44874545   
    44884546    [self updateUI];
     
    45014559    }
    45024560   
     4561    [torrent release];
    45034562}
    45044563
     
    45114570        [fInfoController updateInfoStats];
    45124571   
     4572    [torrent release];
    45134573}
    45144574
  • trunk/macosx/CreatorWindowController.m

    r13248 r13251  
    6868        fStarted = NO;
    6969       
    70         fPath = path;
     70        fPath = [path retain];
    7171        fInfo = tr_metaInfoBuilderCreate([fPath UTF8String]);
    7272       
     
    8282           
    8383            [alert runModal];
    84            
     84            [alert release];
     85           
     86            [self release];
    8587            return nil;
    8688        }
     
    9698           
    9799            [alert runModal];
    98            
     100            [alert release];
     101           
     102            [self release];
    99103            return nil;
    100104        }
     
    167171                                                            fInfo->pieceCount, [NSString stringForFileSize: fInfo->pieceSize]]];
    168172   
    169     fLocation = [[[fDefaults stringForKey: @"CreatorLocation"] stringByExpandingTildeInPath] stringByAppendingPathComponent:
    170                     [name stringByAppendingPathExtension: @"torrent"]];
     173    fLocation = [[[[fDefaults stringForKey: @"CreatorLocation"] stringByExpandingTildeInPath] stringByAppendingPathComponent:
     174                    [name stringByAppendingPathExtension: @"torrent"]] retain];
    171175    [fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
    172176    [fLocationField setToolTip: fLocation];
     
    181185- (void) dealloc
    182186{
    183    
     187    [fPath release];
     188    [fLocation release];
     189   
     190    [fTrackers release];
    184191   
    185192    if (fInfo)
     
    188195    [fTimer invalidate];
    189196   
     197    [super dealloc];
    190198}
    191199
     
    207215        if (result == NSFileHandlingPanelOKButton)
    208216        {
    209             fLocation = [[panel URL] path];
     217            [fLocation release];
     218            fLocation = [[[panel URL] path] retain];
    210219           
    211220            [fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
     
    253262}
    254263
     264- (void) windowWillClose: (NSNotification *) notification
     265{
     266    [self autorelease];
     267}
     268
    255269- (void) cancelCreateProgress: (id) sender
    256270{
     
    359373    BOOL added = NO;
    360374   
    361     for (__strong NSString * tracker in tempTrackers)
     375    for (NSString * tracker in tempTrackers)
    362376    {
    363377        tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
     
    412426    }
    413427   
     428    [alert release];
    414429   
    415430    if (returnCode == NSAlertFirstButtonReturn)
     
    422437    if (![[NSFileManager defaultManager] fileExistsAtPath: [fLocation stringByDeletingLastPathComponent]])
    423438    {
    424         NSAlert * alert = [[NSAlert alloc] init];
     439        NSAlert * alert = [[[NSAlert alloc] init] autorelease];
    425440        [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> directory doesn't exist warning -> button")];
    426441        [alert setMessageText: NSLocalizedString(@"The chosen torrent file location does not exist.",
     
    443458        NSInteger count = [pathComponents count];
    444459       
    445         NSAlert * alert = [[NSAlert alloc] init];
     460        NSAlert * alert = [[[NSAlert alloc] init] autorelease];
    446461        [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> file already exists warning -> button")];
    447462        [alert setMessageText: NSLocalizedString(@"A torrent file with this name and directory cannot be created.",
     
    508523           
    509524            default:
    510                 alert = [[NSAlert alloc] init];
     525                alert = [[[NSAlert alloc] init] autorelease];
    511526                [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> failed -> button")];
    512527                [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Creation of \"%@\" failed.",
  • trunk/macosx/DragOverlayView.m

    r13248 r13251  
    5555                                paragraphStyle, NSParagraphStyleAttributeName, nil];
    5656       
     57        [stringShadow release];
     58        [paragraphStyle release];
    5759    }
    5860    return self;
    5961}
    6062
     63- (void) dealloc
     64{
     65    [fBadge release];
     66   
     67    [fMainLineAttributes release];
     68    [fSubLineAttributes release];
     69   
     70    [super dealloc];
     71}
    6172
    6273- (void) setOverlay: (NSImage *) icon mainLine: (NSString *) mainLine subLine: (NSString *) subLine
    6374{
     75    [fBadge release];
    6476   
    6577    //create badge
  • trunk/macosx/DragOverlayWindow.m

    r13248 r13251  
    4949        DragOverlayView * view = [[DragOverlayView alloc] initWithFrame: [self frame]];
    5050        [self setContentView: view];
     51        [view release];
    5152       
    5253        [self setReleasedWhenClosed: NO];
     
    7778    [[NSNotificationCenter defaultCenter] removeObserver: self];
    7879   
     80    [fFadeInAnimation release];
     81    [fFadeOutAnimation release];
    7982   
     83    [super dealloc];
    8084}
    8185
  • trunk/macosx/ExpandedPathToIconTransformer.h

    r13248 r13251  
    2626
    2727@interface ExpandedPathToIconTransformer : NSValueTransformer
     28{
     29}
    2830
    2931@end
  • trunk/macosx/ExpandedPathToPathTransformer.h

    r13248 r13251  
    2626
    2727@interface ExpandedPathToPathTransformer : NSValueTransformer
     28{
     29}
    2830
    2931@end
  • trunk/macosx/FileListNode.h

    r13248 r13251  
    3535    NSString * fName;
    3636    NSString * fPath;
    37     Torrent * __unsafe_unretained fTorrent;
     37    Torrent * fTorrent;
    3838    uint64_t fSize;
    3939    NSImage * fIcon;
     
    4444@property (nonatomic, readonly) NSString * path;
    4545
    46 @property (nonatomic, readonly, unsafe_unretained) Torrent * torrent;
     46@property (nonatomic, readonly) Torrent * torrent;
    4747
    4848@property (nonatomic, readonly) uint64_t size;
  • trunk/macosx/FileListNode.m

    r13248 r13251  
    8181{
    8282    //this object is essentially immutable after initial setup
    83     return self;
     83    return [self retain];
    8484}
    8585
     86- (void) dealloc
     87{
     88    [fName release];
     89    [fPath release];
     90    [fIndexes release];
     91   
     92    [fIcon release];
     93   
     94    [fChildren release];
     95   
     96    [super dealloc];
     97}
    8698
    8799- (NSString *) description
     
    101113{
    102114    if (!fIcon)
    103         fIcon = [[NSWorkspace sharedWorkspace] iconForFileType: fIsFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon)
    104                                                                             : [fName pathExtension]];
     115        fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: fIsFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon)
     116                                                                            : [fName pathExtension]] retain];
    105117    return fIcon;
    106118}
     
    122134    {
    123135        fIsFolder = isFolder;
    124         fName = name;
    125         fPath = path;
     136        fName = [name retain];
     137        fPath = [path retain];
    126138       
    127139        fIndexes = [[NSMutableIndexSet alloc] init];
  • trunk/macosx/FileNameCell.m

    r13248 r13251  
    7070                                statusParagraphStyle, NSParagraphStyleAttributeName,  nil];
    7171       
     72        [paragraphStyle release];
     73        [statusParagraphStyle release];
    7274    }
    7375    return self;
     76}
     77
     78- (void) dealloc
     79{
     80    [fTitleAttributes release];
     81    [fStatusAttributes release];
     82   
     83    [super dealloc];
     84}
     85
     86- (id) copyWithZone: (NSZone *) zone
     87{
     88    FileNameCell * copy = [super copyWithZone: zone];
     89   
     90    copy->fTitleAttributes = [fTitleAttributes retain];
     91    copy->fStatusAttributes = [fStatusAttributes retain];
     92   
     93    return copy;
    7494}
    7595
     
    174194{
    175195    NSString * title = [(FileListNode *)[self objectValue] name];
    176     return [[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes];
     196    return [[[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes] autorelease];
    177197}
    178198
     
    188208                            "Inspector -> Files tab -> file status string"), percentString, [NSString stringForFileSize: [node size]]];
    189209   
    190     return [[NSAttributedString alloc] initWithString: status attributes: fStatusAttributes];
     210    return [[[NSAttributedString alloc] initWithString: status attributes: fStatusAttributes] autorelease];
    191211}
    192212
  • trunk/macosx/FileOutlineController.h

    r13248 r13251  
    3030@interface FileOutlineController : NSObject
    3131{
    32     __unsafe_unretained Torrent * fTorrent;
     32    Torrent * fTorrent;
    3333    NSMutableArray * fFileList;
    3434   
  • trunk/macosx/FileOutlineController.m

    r13248 r13251  
    7474}
    7575
     76- (void) dealloc
     77{
     78    [fFileList release];
     79    [fFilterText release];
     80   
     81    [super dealloc];
     82}
     83
    7684- (FileOutlineView *) outlineView
    7785{
     
    8593    [fFileList setArray: [fTorrent fileList]];
    8694   
     95    [fFilterText release];
    8796    fFilterText = nil;
    8897   
     
    199208        [fOutline reloadData];
    200209   
    201     fFilterText = text;
     210    [fFilterText release];
     211    fFilterText = [text retain];
    202212}
    203213
     
    512522    [item setTag: FILE_CHECK_TAG];
    513523    [menu addItem: item];
     524    [item release];
    514525   
    515526    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Uncheck Selected", "File Outline -> Menu")
     
    518529    [item setTag: FILE_UNCHECK_TAG];
    519530    [menu addItem: item];
     531    [item release];
    520532   
    521533    //only check selected
     
    524536    [item setTarget: self];
    525537    [menu addItem: item];
     538    [item release];
    526539   
    527540    [menu addItem: [NSMenuItem separatorItem]];
     
    532545    [item setSubmenu: priorityMenu];
    533546    [menu addItem: item];
     547    [item release];
    534548   
    535549    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"High", "File Outline -> Priority Menu")
     
    539553    [item setImage: [NSImage imageNamed: @"PriorityHighTemplate.png"]];
    540554    [priorityMenu addItem: item];
     555    [item release];
    541556   
    542557    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Normal", "File Outline -> Priority Menu")
     
    546561    [item setImage: [NSImage imageNamed: @"PriorityNormalTemplate.png"]];
    547562    [priorityMenu addItem: item];
     563    [item release];
    548564   
    549565    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Low", "File Outline -> Priority Menu")
     
    553569    [item setImage: [NSImage imageNamed: @"PriorityLowTemplate.png"]];
    554570    [priorityMenu addItem: item];
    555    
     571    [item release];
     572   
     573    [priorityMenu release];
    556574   
    557575    [menu addItem: [NSMenuItem separatorItem]];
     
    562580    [item setTarget: self];
    563581    [menu addItem: item];
    564    
    565     return menu;
     582    [item release];
     583   
     584    return [menu autorelease];
    566585}
    567586
  • trunk/macosx/FileOutlineView.m

    r13248 r13251  
    3636    FileNameCell * nameCell = [[FileNameCell alloc] init];
    3737    [[self tableColumnWithIdentifier: @"Name"] setDataCell: nameCell];
     38    [nameCell release];
    3839   
    3940    FilePriorityCell * priorityCell = [[FilePriorityCell alloc] init];
    4041    [[self tableColumnWithIdentifier: @"Priority"] setDataCell: priorityCell];
     42    [priorityCell release];
    4143   
    4244    [self setAutoresizesOutlineColumn: NO];
     
    4648}
    4749
     50- (void) dealloc
     51{
     52    [super dealloc];
     53}
    4854
    4955- (void) mouseDown: (NSEvent *) event
  • trunk/macosx/FilePriorityCell.m

    r13248 r13251  
    102102    NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: options owner: controlView userInfo: userInfo];
    103103    [controlView addTrackingArea: area];
     104    [area release];
    104105}
    105106
  • trunk/macosx/FilterBarController.m

    r13248 r13251  
    129129    [[NSNotificationCenter defaultCenter] removeObserver: self];
    130130   
     131    [super dealloc];
    131132}
    132133
     
    265266        for (NSInteger i = 0; i < groupMenuCount; i++)
    266267        {
    267             NSMenuItem * item = [groupMenu itemAtIndex: 0];
     268            NSMenuItem * item = [[groupMenu itemAtIndex: 0] retain];
    268269            [groupMenu removeItemAtIndex: 0];
    269270            [menu addItem: item];
     271            [item release];
    270272        }
    271273    }
  • trunk/macosx/FilterBarView.m

    r13248 r13251  
    3838}
    3939
     40- (void) dealloc
     41{
     42    [fGradient release];
     43    [super dealloc];
     44}
    4045
    4146- (BOOL) mouseDownCanMoveWindow
  • trunk/macosx/GlobalOptionsPopoverViewController.m

    r13248 r13251  
    141141- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
    142142{
    143     fInitialString = [control stringValue];
     143    [fInitialString release];
     144    fInitialString = [[control stringValue] retain];
    144145   
    145146    return YES;
     
    152153    {
    153154        [control setStringValue: fInitialString];
     155        [fInitialString release];
    154156        fInitialString = nil;
    155157    }
  • trunk/macosx/GroupToolbarItem.m

    r13248 r13251  
    2727@implementation GroupToolbarItem
    2828
     29- (void) dealloc
     30{
     31    [fIdentifiers release];
     32    [super dealloc];
     33}
    2934
    3035- (void) setIdentifiers: (NSArray *) identifiers
    3136{
    32     fIdentifiers = identifiers;
     37    [fIdentifiers release];
     38    fIdentifiers = [identifiers retain];
    3339}
    3440
     
    3945    for (NSInteger i = 0; i < [control segmentCount]; i++)
    4046        [control setEnabled: [[self target] validateToolbarItem:
    41             [[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]]] forSegment: i];
     47            [[[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]] autorelease]] forSegment: i];
    4248}
    4349
     
    5864       
    5965        [menu addItem: addItem];
     66        [addItem release];
    6067    }
    6168   
     69    [menu release];
    6270    [self setMenuFormRepresentation: menuItem];
     71    [menuItem release];
    6372}
    6473
     
    7079    for (NSInteger i = 0; i < count; i++)
    7180        [[[menuItem submenu] itemAtIndex: i] setEnabled: [[self target] validateToolbarItem:
    72             [[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]]]];
     81            [[[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]] autorelease]]];
    7382   
    7483    return menuItem;
  • trunk/macosx/GroupsController.m

    r13248 r13251  
    5555        NSData * data;
    5656        if ((data = [[NSUserDefaults standardUserDefaults] dataForKey: @"GroupDicts"]))
    57             fGroups = [NSKeyedUnarchiver unarchiveObjectWithData: data];
     57            fGroups = [[NSKeyedUnarchiver unarchiveObjectWithData: data] retain];
    5858        else if ((data = [[NSUserDefaults standardUserDefaults] dataForKey: @"Groups"])) //handle old groups
    5959        {
    60             fGroups = [NSUnarchiver unarchiveObjectWithData: data];
     60            fGroups = [[NSUnarchiver unarchiveObjectWithData: data] retain];
    6161            [[NSUserDefaults standardUserDefaults] removeObjectForKey: @"Groups"];
    6262            [self saveGroups];
     
    108108}
    109109
     110- (void) dealloc
     111{
     112    [fGroups release];
     113    [super dealloc];
     114}
    110115
    111116- (NSInteger) numberOfGroups
     
    300305       
    301306        [item setImage: icon];
     307        [icon release];
    302308    }
    303309    else
     
    305311   
    306312    [menu addItem: item];
     313    [item release];
    307314   
    308315    for (NSMutableDictionary * dict in fGroups)
     
    320327           
    321328            [item setImage: icon];
     329            [icon release];
    322330        }
    323331        else
     
    325333       
    326334        [menu addItem: item];
    327     }
    328    
    329     return menu;
     335        [item release];
     336    }
     337   
     338    return [menu autorelease];
    330339}
    331340
     
    354363        [tempDict removeObjectForKey: @"Icon"];
    355364        [groups addObject: tempDict];
     365        [tempDict release];
    356366    }
    357367   
     
    378388                                [NSColor whiteColor]] endingColor: color];
    379389    [gradient drawInBezierPath: bp angle: 270.0];
     390    [gradient release];
    380391   
    381392    //inside
     
    384395                endingColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];
    385396    [gradient drawInBezierPath: bp angle: 270.0];
     397    [gradient release];
    386398   
    387399    [icon unlockFocus];
    388400   
    389401    [dict setObject: icon forKey: @"Icon"];
     402    [icon release];
    390403   
    391404    return icon;
  • trunk/macosx/GroupsPrefsController.m

    r13248 r13251  
    383383    if (location)
    384384    {
    385         ExpandedPathToPathTransformer * pathTransformer = [[ExpandedPathToPathTransformer alloc] init];
     385        ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease];
    386386        [[fCustomLocationPopUp itemAtIndex: 0] setTitle: [pathTransformer transformedValue: location]];
    387         ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
     387        ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease];
    388388        [[fCustomLocationPopUp itemAtIndex: 0] setImage: [iconTransformer transformedValue: location]];
    389389    }
  • trunk/macosx/InfoActivityViewController.m

    r13248 r13251  
    6363    [[NSNotificationCenter defaultCenter] removeObserver: self];
    6464   
    65    
     65    [fTorrents release];
     66   
     67    [super dealloc];
    6668}
    6769
     
    6971{
    7072    //don't check if it's the same in case the metadata changed
    71     fTorrents = torrents;
     73    [fTorrents release];
     74    fTorrents = [torrents retain];
    7275   
    7376    fSet = NO;
  • trunk/macosx/InfoFileViewController.m

    r13248 r13251  
    6262}
    6363
     64- (void) dealloc
     65{
     66    [fTorrents release];
     67   
     68    [super dealloc];
     69}
    6470
    6571- (void) setInfoForTorrents: (NSArray *) torrents
    6672{
    6773    //don't check if it's the same in case the metadata changed
    68     fTorrents = torrents;
     74    [fTorrents release];
     75    fTorrents = [torrents retain];
    6976   
    7077    fSet = NO;
  • trunk/macosx/InfoGeneralViewController.m

    r13248 r13251  
    4545}
    4646
     47- (void) dealloc
     48{
     49    [fTorrents release];
     50   
     51    [super dealloc];
     52}
    4753
    4854- (void) setInfoForTorrents: (NSArray *) torrents
    4955{
    5056    //don't check if it's the same in case the metadata changed
    51     fTorrents = torrents;
     57    [fTorrents release];
     58    fTorrents = [torrents retain];
    5259   
    5360    fSet = NO;
  • trunk/macosx/InfoOptionsViewController.m

    r13248 r13251  
    6969    [[NSNotificationCenter defaultCenter] removeObserver: self];
    7070   
    71    
     71    [fTorrents release];
     72   
     73    [super dealloc];
    7274}
    7375
     
    7577{
    7678    //don't check if it's the same in case the metadata changed
    77     fTorrents = torrents;
     79    [fTorrents release];
     80    fTorrents = [torrents retain];
    7881   
    7982    fSet = NO;
     
    444447- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
    445448{
    446     fInitialString = [control stringValue];
     449    [fInitialString release];
     450    fInitialString = [[control stringValue] retain];
    447451   
    448452    return YES;
     
    455459    {
    456460        [control setStringValue: fInitialString];
     461        [fInitialString release];
    457462        fInitialString = nil;
    458463    }
  • trunk/macosx/InfoPeersViewController.m

    r13248 r13251  
    9999}
    100100
     101- (void) dealloc
     102{
     103    [fTorrents release];
     104   
     105    [fPeers release];
     106    [fWebSeeds release];
     107   
     108    [fWebSeedTableAnimation release];
     109   
     110    [super dealloc];
     111}
    101112
    102113#warning subclass?
     
    104115{
    105116    //don't check if it's the same in case the metadata changed
    106     fTorrents = torrents;
     117    [fTorrents release];
     118    fTorrents = [torrents retain];
    107119   
    108120    fSet = NO;
     
    232244        [self setWebSeedTableHidden: !fWebSeeds animate: NO];
    233245   
     246    [fPeers release];
    234247    fPeers = nil;
     248    [fWebSeeds release];
    235249    fWebSeeds = nil;
    236250}
     
    437451    if (animation == fWebSeedTableAnimation)
    438452    {
     453        [fWebSeedTableAnimation release];
    439454        fWebSeedTableAnimation = nil;
    440455    }
     
    446461    {
    447462        [fWebSeedTableAnimation stopAnimation]; // jumps to end frame
     463        [fWebSeedTableAnimation release];
    448464        fWebSeedTableAnimation = nil;
    449465    }
     
    460476    if ([fTorrents count] == 0)
    461477    {
     478        [fPeers release];
    462479        fPeers = nil;
    463480        [fPeerTable reloadData];
     
    477494    if (!hasWebSeeds)
    478495    {
     496        [fWebSeeds release];
    479497        fWebSeeds = nil;
    480498        [fWebSeedTable reloadData];
     
    493511    {
    494512        [fWebSeedTableAnimation stopAnimation];
     513        [fWebSeedTableAnimation release];
    495514        fWebSeedTableAnimation = nil;
    496515    }
  • trunk/macosx/InfoTabButtonBack.m

    r13248 r13251  
    3838}
    3939
     40- (void) dealloc
     41{
     42    [fGradient release];
     43    [super dealloc];
     44}
    4045
    4146- (void) drawRect: (NSRect) rect
  • trunk/macosx/InfoTabButtonCell.m

    r13248 r13251  
    3838   
    3939    //expects the icon to currently be set as the image
    40     fIcon = [self image];
     40    fIcon = [[self image] retain];
    4141    [self setSelectedTab: fSelected];
    4242}
     
    4646    [[NSNotificationCenter defaultCenter] removeObserver: self];
    4747   
     48    [fIcon release];
     49    [super dealloc];
    4850}
    4951
     
    8486   
    8587    [gradient drawInRect: tabRect angle: 270.0];
     88    [gradient release];
    8689   
    8790    if (fIcon)
     
    99102   
    100103    [self setImage: tabImage];
     104    [tabImage release];
    101105}
    102106
  • trunk/macosx/InfoTrackersViewController.m

    r13248 r13251  
    7575}
    7676
     77- (void) dealloc
     78{
     79    [fTorrents release];
     80    [fTrackers release];
     81    [fTrackerCell release];
     82   
     83    [super dealloc];
     84}
    7785
    7886- (void) setInfoForTorrents: (NSArray *) torrents
    7987{
    8088    //don't check if it's the same in case the metadata changed
    81     fTorrents = torrents;
     89    [fTorrents release];
     90    fTorrents = [torrents retain];
    8291   
    8392    fSet = NO;
     
    98107       
    99108        if ([fTorrents count] == 1)
    100             fTrackers = [[fTorrents objectAtIndex: 0] allTrackerStats];
     109            fTrackers = [[[fTorrents objectAtIndex: 0] allTrackerStats] retain];
    101110        else
    102111        {
     
    113122            [fTrackerTable reloadData];
    114123       
     124        [oldTrackers release];
    115125    }
    116126    else
     
    121131        NSArray * tierAndTrackerBeingAdded = [fTrackers objectsAtIndexes: addedIndexes];
    122132       
    123         fTrackers = [[fTorrents objectAtIndex: 0] allTrackerStats];
     133        [fTrackers release];
     134        fTrackers = [[[fTorrents objectAtIndex: 0] allTrackerStats] retain];
    124135        [fTrackers addObjectsFromArray: tierAndTrackerBeingAdded];
    125136       
     
    139150- (void) clearView
    140151{
     152    [fTrackers release];
    141153    fTrackers = nil;
    142154}
     
    220232   
    221233    //reset table with either new or old value
    222     fTrackers = [torrent allTrackerStats];
     234    [fTrackers release];
     235    fTrackers = [[torrent allTrackerStats] retain];
    223236   
    224237    [fTrackerTable setTrackers: fTrackers];
     
    254267        if (numberSelected == 0)
    255268        {
     269            [fTrackers release];
    256270            fTrackers = nil;
    257271           
     
    380394        if ([[alert suppressionButton] state] == NSOnState)
    381395            [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningRemoveTrackers"];
     396        [alert release];
    382397       
    383398        if (result != NSAlertFirstButtonReturn)
     
    393408   
    394409    //reset table with either new or old value
     410    [fTrackers release];
    395411    fTrackers = [[NSMutableArray alloc] init];
    396412    for (Torrent * torrent in fTorrents)
  • trunk/macosx/InfoWindowController.m

    r13248 r13251  
    141141        [fViewController saveViewSize];
    142142   
    143    
    144    
     143    [fGeneralViewController dealloc];
     144    [fActivityViewController dealloc];
     145    [fTrackersViewController dealloc];
     146    [fPeersViewController dealloc];
     147    [fFileViewController dealloc];
     148    [fOptionsViewController dealloc];
     149   
     150    [fTorrents release];
     151   
     152    [super dealloc];
    145153}
    146154
     
    150158        return;
    151159   
    152     fTorrents = torrents;
     160    [fTorrents release];
     161    fTorrents = [torrents retain];
    153162   
    154163    [self resetInfo];
  • trunk/macosx/MessageWindowController.m

    r13248 r13251  
    105105    [fFilterField setFrame: filterButtonFrame];
    106106   
    107     fAttributes = [[[[fMessageTable tableColumnWithIdentifier: @"Message"] dataCell] attributedStringValue]
    108                     attributesAtIndex: 0 effectiveRange: NULL];
     107    fAttributes = [[[[[fMessageTable tableColumnWithIdentifier: @"Message"] dataCell] attributedStringValue]
     108                    attributesAtIndex: 0 effectiveRange: NULL] retain];
    109109   
    110110    //select proper level in popup button
     
    136136   
    137137    [fTimer invalidate];
    138    
    139    
    140    
     138    [fLock release];
     139   
     140    [fMessages release];
     141    [fDisplayedMessages release];
     142   
     143    [fAttributes release];
     144   
     145    [super dealloc];
    141146}
    142147
     
    387392            NSArray * descriptors = [[NSArray alloc] initWithObjects: descriptor, nil];
    388393            NSArray * sortedMessages = [fDisplayedMessages sortedArrayUsingDescriptors: descriptors];
     394            [descriptors release];
    389395           
    390396            //create the text to output
     
    406412               
    407413                [alert runModal];
     414                [alert release];
    408415            }
    409416        }
  • trunk/macosx/NSImageAdditions.m

    r13248 r13251  
    4040    [coloredImage unlockFocus];
    4141   
    42     return coloredImage;
     42    return [coloredImage autorelease];
    4343}
    4444
  • trunk/macosx/NSMutableArrayAdditions.m

    r13248 r13251  
    3232        return;
    3333   
    34     id object = [self objectAtIndex: fromIndex];
     34    id object = [[self objectAtIndex: fromIndex] retain];
    3535   
    3636    //shift objects - more efficient than simply removing the object and re-inserting the object
     
    4747    [self replaceObjectAtIndex: toIndex withObject: object];
    4848   
     49    [object release];
    4950}
    5051
  • trunk/macosx/NSStringAdditions.m

    r13248 r13251  
    5151+ (NSString *) formattedUInteger: (NSUInteger) value
    5252{
    53     NSNumberFormatter * numberFormatter = [[NSNumberFormatter alloc] init];
     53    NSNumberFormatter * numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
    5454    [numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
    5555    [numberFormatter setMaximumFractionDigits: 0];
     
    239239   
    240240    NSString * fileSizeString = [numberFormatter stringFromNumber: [NSNumber numberWithFloat: convertedSize]];
     241    [numberFormatter release];
    241242   
    242243    if (!notAllowedUnit || ![unit isEqualToString: notAllowedUnit])
  • trunk/macosx/PeerProgressIndicatorCell.m

    r13249 r13251  
    2626#import "NSStringAdditions.h"
    2727
     28#import "transmission.h" // required by utils.h
     29#import "utils.h"
     30
    2831@implementation PeerProgressIndicatorCell
     32
     33- (id) copyWithZone: (NSZone *) zone
     34{
     35    PeerProgressIndicatorCell * copy = [super copyWithZone: zone];
     36    copy->fAttributes = [fAttributes retain];
     37   
     38    return copy;
     39}
     40
     41- (void) dealloc
     42{
     43    [fAttributes release];
     44    [super dealloc];
     45}
    2946
    3047- (void) setSeed: (BOOL) seed
     
    4461            fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont systemFontOfSize: 11.0], NSFontAttributeName,
    4562                                                                            paragraphStyle, NSParagraphStyleAttributeName, nil];
     63            [paragraphStyle release];
    4664        }
    4765       
     
    5169    {
    5270        //attributes not needed anymore
    53         fAttributes = nil;
     71        if (fAttributes)
     72        {
     73            [fAttributes release];
     74            fAttributes = nil;
     75        }
    5476       
    5577        [super drawWithFrame: cellFrame inView: controlView];
  • trunk/macosx/PiecesView.h

    r13248 r13251  
    3333    NSColor * fGreenAvailabilityColor, * fBluePieceColor;
    3434   
    35     __unsafe_unretained Torrent * fTorrent;
     35    Torrent * fTorrent;
    3636    NSInteger fNumPieces, fAcross, fWidth, fExtraBorder;
    3737}
  • trunk/macosx/PiecesView.m

    r13248 r13251  
    4949{
    5050    //store box colors
    51     fGreenAvailabilityColor = [NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0];
    52     fBluePieceColor = [NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0];
     51    fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0] retain];
     52    fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain];
    5353   
    5454    //actually draw the box
     
    6060    tr_free(fPieces);
    6161   
    62    
     62    [fGreenAvailabilityColor release];
     63    [fBluePieceColor release];
     64   
     65    [super dealloc];
    6366}
    6467
     
    8588                                endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]];
    8689    [gradient drawInRect: [self bounds] angle: 90.0];
     90    [gradient release];
    8791    [back unlockFocus];
    8892   
    8993    [self setImage: back];
     94    [back release];
    9095   
    9196    [self setNeedsDisplay];
  • trunk/macosx/PortChecker.h

    r13248 r13251  
    3535@interface PortChecker : NSObject
    3636{   
    37     __unsafe_unretained id fDelegate;
     37    id fDelegate;
    3838    port_status_t fStatus;
    3939   
  • trunk/macosx/PortChecker.m

    r13248 r13251  
    5959    [fTimer invalidate];
    6060   
     61    [fConnection release];
     62    [fPortProbeData release];
     63    [super dealloc];
    6164}
    6265
     
    9396{
    9497    NSString * probeString = [[NSString alloc] initWithData: fPortProbeData encoding: NSUTF8StringEncoding];
     98    [fPortProbeData release];
    9599    fPortProbeData = nil;
    96100   
     
    106110            [self callBackWithStatus: PORT_STATUS_ERROR];
    107111        }
     112        [probeString release];
    108113    }
    109114    else
  • trunk/macosx/PredicateEditorRowTemplateAny.h

    r13248 r13251  
    2626
    2727@interface PredicateEditorRowTemplateAny : NSPredicateEditorRowTemplate
     28{
     29}
    2830
    2931@end
  • trunk/macosx/PrefsController.m

    r13248 r13251  
    128128        fRPCWhitelistArray = [[fDefaults arrayForKey: @"RPCWhitelist"] mutableCopy];
    129129        if (!fRPCWhitelistArray)
    130             fRPCWhitelistArray = [NSMutableArray arrayWithObject: @"127.0.0.1"];
     130            fRPCWhitelistArray = [[NSMutableArray arrayWithObject: @"127.0.0.1"] retain];
    131131        [self updateRPCWhitelist];
    132132       
     
    156156    {
    157157        [fPortChecker cancelProbe];
    158     }
    159    
    160    
    161    
     158        [fPortChecker release];
     159    }
     160   
     161    [fRPCWhitelistArray release];
     162   
     163    [fRPCPassword release];
     164   
     165    [super dealloc];
    162166}
    163167
     
    173177    [toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
    174178    [[self window] setToolbar: toolbar];
     179    [toolbar release];
    175180   
    176181    [self setPrefView: nil];
     
    307312    else
    308313    {
     314        [item release];
    309315        return nil;
    310316    }
    311317
    312     return item;
     318    return [item autorelease];
    313319}
    314320
     
    392398        {
    393399            [fPortChecker cancelProbe];
     400            [fPortChecker release];
    394401        }
    395402        BOOL delay = natStatusChanged || tr_sessionIsPortForwardingEnabled(fHandle);
     
    419426            break;
    420427    }
     428    [fPortChecker release];
    421429    fPortChecker = nil;
    422430}
     
    429437                                NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES);
    430438   
    431     for (__strong NSString * directory in directories)
     439    for (NSString * directory in directories)
    432440    {
    433441        directory = [directory stringByAppendingPathComponent: @"Sounds"];
     
    437445        {
    438446            NSArray * directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: directory error: NULL];
    439             for (__strong NSString * sound in directoryContents)
     447            for (NSString * sound in directoryContents)
    440448            {
    441449                sound = [sound stringByDeletingPathExtension];
     
    694702+ (NSDate *) timeSumToDate: (NSInteger) sum
    695703{
    696     NSDateComponents * comps = [[NSDateComponents alloc] init];
     704    NSDateComponents * comps = [[[NSDateComponents alloc] init] autorelease];
    697705    [comps setHour: sum / 60];
    698706    [comps setMinute: sum % 60];
     
    703711- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
    704712{
    705     fInitialString = [control stringValue];
     713    [fInitialString release];
     714    fInitialString = [[control stringValue] retain];
    706715   
    707716    return YES;
     
    714723    {
    715724        [control setStringValue: fInitialString];
     725        [fInitialString release];
    716726        fInitialString = nil;
    717727    }
     
    749759{
    750760    NSString * bundleID = [[NSBundle mainBundle] bundleIdentifier];
    751     const OSStatus result = LSSetDefaultHandlerForURLScheme((CFStringRef)@"magnet", (__bridge CFStringRef)bundleID);
     761    const OSStatus result = LSSetDefaultHandlerForURLScheme((CFStringRef)@"magnet", (CFStringRef)bundleID);
    752762    if (result != noErr)
    753763        NSLog(@"Failed setting default magnet link handler");
     
    973983- (void) setRPCPassword: (id) sender
    974984{
     985    [fRPCPassword release];
    975986    fRPCPassword = [[sender stringValue] copy];
    976987   
     
    988999        strlen(RPC_KEYCHAIN_NAME), RPC_KEYCHAIN_NAME, &passwordLength, (void **)&password, NULL);
    9891000   
     1001    [fRPCPassword release];
    9901002    if (password != NULL)
    9911003    {
  • trunk/macosx/PrefsWindow.h

    r13248 r13251  
    2626
    2727@interface PrefsWindow : NSWindow
     28{
     29}
    2830
    2931@end
  • trunk/macosx/ProgressGradients.m

    r13249 r13251  
    3939                        alpha: alpha];
    4040   
    41     return [[NSGradient alloc] initWithColorsAndLocations: baseColor, 0.0, color2, 0.5, color3, 0.5, baseColor, 1.0, nil];
     41    NSGradient * progressGradient = [[NSGradient alloc] initWithColorsAndLocations: baseColor, 0.0, color2, 0.5, color3, 0.5,
     42                                        baseColor, 1.0, nil];
     43    return [progressGradient autorelease];
    4244}
    4345
  • trunk/macosx/StatsWindowController.m

    r13248 r13251  
    127127    [fTimer invalidate];
    128128   
     129    [fStatsWindowInstance autorelease];
    129130    fStatsWindowInstance = nil;
    130131}
  • trunk/macosx/StatusBarController.m

    r13248 r13251  
    9191    [[NSNotificationCenter defaultCenter] removeObserver: self];
    9292   
     93    [super dealloc];
    9394}
    9495
  • trunk/macosx/StatusBarView.m

    r13248 r13251  
    5353    [[NSNotificationCenter defaultCenter] removeObserver: self];
    5454   
     55    [fGradient release];
     56    [super dealloc];
    5557}
    5658
  • trunk/macosx/Torrent.m

    r13248 r13251  
    6363void startQueueCallback(tr_torrent * torrent, void * torrentData)
    6464{
    65     [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(startQueue) withObject: nil waitUntilDone: NO];
     65    [(Torrent *)torrentData performSelectorOnMainThread: @selector(startQueue) withObject: nil waitUntilDone: NO];
    6666}
    6767
     
    7272        NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status",
    7373                               [NSNumber numberWithBool: wasRunning], @"WasRunning", nil];
    74         [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];
     74        [(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];
    7575    }
    7676}
     
    7878void ratioLimitHitCallback(tr_torrent * torrent, void * torrentData)
    7979{
    80     [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(ratioLimitHit) withObject: nil waitUntilDone: NO];
     80    [(Torrent *)torrentData performSelectorOnMainThread: @selector(ratioLimitHit) withObject: nil waitUntilDone: NO];
    8181}
    8282
    8383void idleLimitHitCallback(tr_torrent * torrent, void * torrentData)
    8484{
    85     [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(idleLimitHit) withObject: nil waitUntilDone: NO];
     85    [(Torrent *)torrentData performSelectorOnMainThread: @selector(idleLimitHit) withObject: nil waitUntilDone: NO];
    8686}
    8787
    8888void metadataCallback(tr_torrent * torrent, void * torrentData)
    8989{
    90     [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(metadataRetrieved) withObject: nil waitUntilDone: NO];
     90    [(Torrent *)torrentData performSelectorOnMainThread: @selector(metadataRetrieved) withObject: nil waitUntilDone: NO];
    9191}
    9292
     
    212212    if (fFileStat)
    213213        tr_torrentFilesFree(fFileStat, [self fileCount]);
     214   
     215    [fPreviousFinishedIndexes release];
     216    [fPreviousFinishedIndexesDate release];
     217   
     218    [fHashString release];
     219   
     220    [fIcon release];
     221   
     222    [fFileList release];
     223    [fFlatFileList release];
     224   
     225    [fTimeMachineExclude release];
     226   
     227    [super dealloc];
    214228}
    215229
     
    221235- (id) copyWithZone: (NSZone *) zone
    222236{
    223     return self;
     237    return [self retain];
    224238}
    225239
     
    230244    {
    231245        [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
     246        [fTimeMachineExclude release];
    232247        fTimeMachineExclude = nil;
    233248    }
     
    268283- (void) setPreviousFinishedPieces: (NSIndexSet *) indexes
    269284{
    270     fPreviousFinishedIndexes = indexes;
    271    
     285    [fPreviousFinishedIndexes release];
     286    fPreviousFinishedIndexes = [indexes retain];
     287   
     288    [fPreviousFinishedIndexesDate release];
    272289    fPreviousFinishedIndexesDate = indexes != nil ? [[NSDate alloc] init] : nil;
    273290}
     
    514531       
    515532        [alert runModal];
     533        [alert release];
    516534       
    517535        return;
     
    535553       
    536554        [alert runModal];
     555        [alert release];
    537556    }
    538557   
     
    578597            if ([[alert suppressionButton] state] == NSOnState)
    579598                [fDefaults setBool: NO forKey: @"WarningRemainingSpace"];
     599            [alert release];
    580600           
    581601            return result != NSAlertFirstButtonReturn;
     
    592612    #warning replace kGenericFolderIcon stuff with NSImageNameFolder on 10.6
    593613    if (!fIcon)
    594         fIcon = [[NSWorkspace sharedWorkspace] iconForFileType: [self isFolder] ? NSFileTypeForHFSTypeCode(kGenericFolderIcon)
    595                                                                                 : [[self name] pathExtension]];
     614        fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: [self isFolder] ? NSFileTypeForHFSTypeCode(kGenericFolderIcon)
     615                                                                                : [[self name] pathExtension]] retain];
    596616    return fIcon;
    597617}
     
    636656        TrackerNode * tracker = [[TrackerNode alloc] initWithTrackerStat: &stats[i] torrent: self];
    637657        [trackers addObject: tracker];
     658        [tracker release];
    638659    }
    639660   
     
    15281549    {
    15291550        [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
     1551        [fTimeMachineExclude release];
    15301552        fTimeMachineExclude = nil;
    15311553    }
     
    15351557    {
    15361558        [self setTimeMachineExclude: YES forPath: currentLocation];
    1537         fTimeMachineExclude = currentLocation;
     1559        fTimeMachineExclude = [currentLocation retain];
    15381560    }
    15391561}
     
    16301652        if (!fHandle)
    16311653        {
     1654            [self release];
    16321655            return nil;
    16331656        }
     
    16361659    fInfo = tr_torrentInfo(fHandle);
    16371660   
    1638     tr_torrentSetQueueStartCallback(fHandle, startQueueCallback, (__bridge void *)(self));
    1639     tr_torrentSetCompletenessCallback(fHandle, completenessChangeCallback, (__bridge void *)(self));
    1640     tr_torrentSetRatioLimitHitCallback(fHandle, ratioLimitHitCallback, (__bridge void *)(self));
    1641     tr_torrentSetIdleLimitHitCallback(fHandle, idleLimitHitCallback, (__bridge void *)(self));
    1642     tr_torrentSetMetadataCallback(fHandle, metadataCallback, (__bridge void *)(self));
     1661    tr_torrentSetQueueStartCallback(fHandle, startQueueCallback, self);
     1662    tr_torrentSetCompletenessCallback(fHandle, completenessChangeCallback, self);
     1663    tr_torrentSetRatioLimitHitCallback(fHandle, ratioLimitHitCallback, self);
     1664    tr_torrentSetIdleLimitHitCallback(fHandle, idleLimitHitCallback, self);
     1665    tr_torrentSetMetadataCallback(fHandle, metadataCallback, self);
    16431666   
    16441667    fHashString = [[NSString alloc] initWithUTF8String: fInfo->hashString];
     
    16551678        name: @"GroupValueRemoved" object: nil];
    16561679   
    1657     fTimeMachineExclude = timeMachineExclude;
     1680    fTimeMachineExclude = [timeMachineExclude retain];
    16581681    [self update];
    16591682   
     
    16981721                    node = [[FileListNode alloc] initWithFolderName: name path: path torrent: self];
    16991722                    [fileList addObject: node];
     1723                    [node release];
    17001724                }
    17011725               
     
    17101734                [fileList addObject: node];
    17111735                [flatFileList addObject: node];
     1736                [node release];
    17121737            }
    17131738        }
     
    17221747    {
    17231748        FileListNode * node = [[FileListNode alloc] initWithFileName: [self name] path: @"" size: [self size] index: 0 torrent: self];
    1724         fFileList = [NSArray arrayWithObject: node];
    1725         fFlatFileList = fFileList;
     1749        fFileList = [[NSArray arrayWithObject: node] retain];
     1750        fFlatFileList = [fFileList retain];
     1751        [node release];
    17261752    }
    17271753}
     
    17591785       
    17601786        [parent insertChild: node];
     1787        [node release];
    17611788    }
    17621789   
     
    17951822        case TR_SEED:
    17961823        case TR_PARTIAL_SEED:
    1797         {
    17981824            //simpler to create a new dictionary than to use statusInfo - avoids retention chicanery
    17991825            [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self
     
    18061832            {
    18071833                NSDictionary * quarantineProperties = [NSDictionary dictionaryWithObject: (NSString *)kLSQuarantineTypeOtherDownload forKey: (NSString *)kLSQuarantineTypeKey];
    1808                 if (LSSetItemAttribute(&ref, kLSRolesAll, kLSItemQuarantineProperties, (__bridge void *)quarantineProperties) != noErr)
     1834                if (LSSetItemAttribute(&ref, kLSRolesAll, kLSItemQuarantineProperties, quarantineProperties) != noErr)
    18091835                    NSLog(@"Failed to quarantine: %@", dataLocation);
    18101836            }
     
    18131839           
    18141840            break;
    1815         }
    18161841       
    18171842        case TR_LEECH:
     
    18191844            break;
    18201845    }
     1846    [statusInfo release];
    18211847   
    18221848    [self update];
     
    18931919- (void) setTimeMachineExclude: (BOOL) exclude forPath: (NSString *) path
    18941920{
    1895     CSBackupSetItemExcluded((__bridge CFURLRef)[NSURL fileURLWithPath: path], exclude, true);
     1921    CSBackupSetItemExcluded((CFURLRef)[NSURL fileURLWithPath: path], exclude, true);
    18961922}
    18971923
  • trunk/macosx/TorrentCell.m

    r13248 r13251  
    110110        [fStatusAttributes setObject: paragraphStyle forKey: NSParagraphStyleAttributeName];
    111111       
    112        
    113         fBluePieceColor = [NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0];
    114         fBarBorderColor = [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.2];
    115         fBarMinimalBorderColor = [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.015];
     112        [paragraphStyle release];
     113       
     114        fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain];
     115        fBarBorderColor = [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.2] retain];
     116        fBarMinimalBorderColor = [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.015] retain];
    116117    }
    117118        return self;
     
    242243        NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: rowOptions owner: controlView userInfo: rowInfo];
    243244        [controlView addTrackingArea: area];
     245        [rowInfo release];
     246        [area release];
    244247    }
    245248   
     
    258261                                userInfo: controlInfo];
    259262    [controlView addTrackingArea: area];
     263    [controlInfo release];
     264    [area release];
    260265   
    261266    //reveal button
     
    273278                                userInfo: revealInfo];
    274279    [controlView addTrackingArea: area];
     280    [revealInfo release];
     281    [area release];
    275282   
    276283    //action button
     
    287294    area = [[NSTrackingArea alloc] initWithRect: actionButtonRect options: actionOptions owner: controlView userInfo: actionInfo];
    288295    [controlView addTrackingArea: area];
     296    [actionInfo release];
     297    [area release];
    289298}
    290299
     
    352361                                    ofColor: [NSColor whiteColor]] endingColor: darkGroupColor];
    353362        [gradient drawInBezierPath: bp angle: 90.0];
     363        [gradient release];
    354364    }
    355365   
     
    684694        fraction: ([fDefaults boolForKey: @"SmallView"] ? 0.25 : 1.0) respectFlipped: YES hints: nil];
    685695
     696    [bitmap release];
    686697}
    687698
     
    818829{
    819830    NSString * title = [(Torrent *)[self representedObject] name];
    820     return [[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes];
     831    return [[[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes] autorelease];
    821832}
    822833
    823834- (NSAttributedString *) attributedStatusString: (NSString *) string
    824835{
    825     return [[NSAttributedString alloc] initWithString: string attributes: fStatusAttributes];
     836    return [[[NSAttributedString alloc] initWithString: string attributes: fStatusAttributes] autorelease];
    826837}
    827838
  • trunk/macosx/TorrentGroup.m

    r13248 r13251  
    4242}
    4343
     44- (void) dealloc
     45{
     46    [fTorrents release];
     47    [super dealloc];
     48}
    4449
    4550- (NSString *) description
  • trunk/macosx/TorrentTableView.m

    r13249 r13251  
    9090{
    9191    [[NSNotificationCenter defaultCenter] removeObserver: self];
     92   
     93    [fCollapsedGroups release];
     94   
     95    [fPiecesBarAnimation release];
     96    [fMenuTorrent release];
     97   
     98    [fSelectedValues release];
     99   
     100    [fTorrentCell release];
     101   
     102    [super dealloc];
    92103}
    93104
     
    381392    //if pushing a button, don't change the selected rows
    382393    if (pushed)
    383         fSelectedValues = [self selectedValues];
     394        fSelectedValues = [[self selectedValues] retain];
    384395   
    385396    [super mouseDown: event];
    386397   
     398    [fSelectedValues release];
    387399    fSelectedValues = nil;
    388400   
     
    626638        [infoViewController updateInfo];
    627639       
     640        [infoViewController release];
     641        [popover release];
    628642    }
    629643    else
    630644    {
    631645        //update file action menu
    632         fMenuTorrent = [self itemAtRow: row];
     646        fMenuTorrent = [[self itemAtRow: row] retain];
    633647       
    634648        //update global limit check
     
    642656        [fActionMenu popUpMenuPositioningItem: nil atLocation: location inView: self];
    643657       
     658        [fMenuTorrent release];
    644659        fMenuTorrent = nil;
    645660    }
     
    680695                [item setRepresentedObject: [NSNumber numberWithInt: speedLimitActionValue[i]]];
    681696                [menu addItem: item];
     697                [item release];
    682698            }
    683699        }
     
    708724                [item setRepresentedObject: [NSNumber numberWithFloat: ratioLimitActionValue[i]]];
    709725                [menu addItem: item];
     726                [item release];
    710727            }
    711728        }
     
    820837- (void) togglePiecesBar
    821838{
     839    //stop previous animation
     840    if (fPiecesBarAnimation)
     841        [fPiecesBarAnimation release];
     842   
    822843    NSMutableArray * progressMarks = [NSMutableArray arrayWithCapacity: 16];
    823     for (NSAnimationProgress i = 1.0/16; i <= 1.0; i += 1.0/16)
     844    for (NSAnimationProgress i = 0.0625; i <= 1.0; i += 0.0625)
    824845        [progressMarks addObject: [NSNumber numberWithFloat: i]];
    825846   
     
    836857    if (animation == fPiecesBarAnimation)
    837858    {
     859        [fPiecesBarAnimation release];
    838860        fPiecesBarAnimation = nil;
    839861    }
  • trunk/macosx/TrackerCell.m

    r13248 r13251  
    8484                                paragraphStyle, NSParagraphStyleAttributeName, nil];
    8585       
     86        [paragraphStyle release];
    8687    }
    8788    return self;
     89}
     90
     91- (void) dealloc
     92{
     93    [fNameAttributes release];
     94    [fStatusAttributes release];
     95   
     96    [super dealloc];
     97}
     98
     99- (id) copyWithZone: (NSZone *) zone
     100{
     101    TrackerCell * copy = [super copyWithZone: zone];
     102   
     103    copy->fNameAttributes = [fNameAttributes retain];
     104    copy->fStatusAttributes = [fStatusAttributes retain];
     105   
     106    return copy;
    88107}
    89108
     
    224243        {
    225244            [fTrackerIconCache setObject: icon forKey: baseAddress];
     245            [icon release];
    226246           
    227247            [[self controlView] setNeedsDisplay: YES];
     
    283303{
    284304    NSString * name = [(TrackerNode *)[self objectValue] host];
    285     return [[NSAttributedString alloc] initWithString: name attributes: fNameAttributes];
     305    return [[[NSAttributedString alloc] initWithString: name attributes: fNameAttributes] autorelease];
    286306}
    287307
    288308- (NSAttributedString *) attributedStatusWithString: (NSString *) statusString
    289309{
    290     return [[NSAttributedString alloc] initWithString: statusString attributes: fStatusAttributes];
     310    return [[[NSAttributedString alloc] initWithString: statusString attributes: fStatusAttributes] autorelease];
    291311}
    292312
     
    294314{
    295315    NSString * countString = count != -1 ? [NSString stringWithFormat: @"%d", count] : NSLocalizedString(@"N/A", "tracker peer stat");
    296     return [[NSAttributedString alloc] initWithString: countString attributes: fStatusAttributes];
     316    return [[[NSAttributedString alloc] initWithString: countString attributes: fStatusAttributes] autorelease];
    297317}
    298318
  • trunk/macosx/TrackerNode.h

    r13248 r13251  
    3232    tr_tracker_stat fStat;
    3333   
    34     __unsafe_unretained Torrent * fTorrent;
     34    Torrent * fTorrent;
    3535}
    3636
    37 @property (nonatomic, readonly, assign) Torrent * torrent;
     37@property (nonatomic, readonly) Torrent * torrent;
    3838
    3939- (id) initWithTrackerStat: (tr_tracker_stat *) stat torrent: (Torrent *) torrent;
  • trunk/macosx/TrackerNode.m

    r13248 r13251  
    2929
    3030#warning remove ivars in header when 64-bit only (or it compiles in 32-bit mode)
    31 #warning make weak when 10.7-only (not assign)
    3231@synthesize torrent = fTorrent;
    3332
     
    3736    {
    3837        fStat = *stat;
    39         #warning make __weak when 10.7-only
    40         fTorrent = torrent;
     38        fTorrent = torrent; //weak reference
    4139    }
    4240   
     
    5250{
    5351    //this object is essentially immutable after initial setup
    54     return self;
     52    return [self retain];
    5553}
    5654
     
    115113       
    116114        dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastAnnounceTime]];
     115        [dateFormatter release];
    117116    }
    118117    else
     
    185184       
    186185        dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastScrapeTime]];
     186        [dateFormatter release];
    187187    }
    188188    else
  • trunk/macosx/TrackerTableView.h

    r13248 r13251  
    2929@interface TrackerTableView : NSTableView
    3030{
    31     __unsafe_unretained Torrent * fTorrent;
    32     __unsafe_unretained NSArray * fTrackers;
     31    //weak references
     32    Torrent * fTorrent;
     33    NSArray * fTrackers;
    3334}
    3435
  • trunk/macosx/URLSheetWindow.xib

    r13248 r13251  
    33        <data>
    44                <int key="IBDocument.SystemTarget">1060</int>
    5                 <string key="IBDocument.SystemVersion">11D50</string>
    6                 <string key="IBDocument.InterfaceBuilderVersion">2182</string>
    7                 <string key="IBDocument.AppKitVersion">1138.32</string>
    8                 <string key="IBDocument.HIToolboxVersion">568.00</string>
     5                <string key="IBDocument.SystemVersion">11B26</string>
     6                <string key="IBDocument.InterfaceBuilderVersion">1617</string>
     7                <string key="IBDocument.AppKitVersion">1138</string>
     8                <string key="IBDocument.HIToolboxVersion">566.00</string>
    99                <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
    1010                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
    11                         <string key="NS.object.0">2182</string>
     11                        <string key="NS.object.0">1617</string>
    1212                </object>
    1313                <array key="IBDocument.IntegratedClassDependencies">
     
    2323                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
    2424                </array>
    25                 <object class="NSMutableDictionary" key="IBDocument.Metadata">
    26                         <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
    27                         <integer value="1" key="NS.object.0"/>
    28                 </object>
     25                <dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
    2926                <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
    3027                        <object class="NSCustomObject" id="1001">
     
    5047                                <string key="NSWindowContentMinSize">{400, 177}</string>
    5148                                <object class="NSView" key="NSWindowView" id="892541411">
    52                                         <reference key="NSNextResponder"/>
     49                                        <nil key="NSNextResponder"/>
    5350                                        <int key="NSvFlags">256</int>
    5451                                        <array class="NSMutableArray" key="NSSubviews">
     
    5855                                                        <string key="NSFrame">{{20, 50}, {360, 80}}</string>
    5956                                                        <reference key="NSSuperview" ref="892541411"/>
    60                                                         <reference key="NSWindow"/>
    61                                                         <reference key="NSNextKeyView" ref="9691643"/>
    6257                                                        <bool key="NSEnabled">YES</bool>
    6358                                                        <object class="NSTextFieldCell" key="NSCell" id="139057847">
     
    9792                                                        <string key="NSFrame">{{304, 12}, {82, 32}}</string>
    9893                                                        <reference key="NSSuperview" ref="892541411"/>
    99                                                         <reference key="NSWindow"/>
    100                                                         <reference key="NSNextKeyView"/>
    10194                                                        <bool key="NSEnabled">YES</bool>
    10295                                                        <object class="NSButtonCell" key="NSCell" id="62424678">
     
    120113                                                        <string key="NSFrame">{{222, 12}, {82, 32}}</string>
    121114                                                        <reference key="NSSuperview" ref="892541411"/>
    122                                                         <reference key="NSWindow"/>
    123                                                         <reference key="NSNextKeyView" ref="794131740"/>
    124115                                                        <bool key="NSEnabled">YES</bool>
    125116                                                        <object class="NSButtonCell" key="NSCell" id="341887532">
     
    143134                                                        <string key="NSFrame">{{17, 140}, {366, 17}}</string>
    144135                                                        <reference key="NSSuperview" ref="892541411"/>
    145                                                         <reference key="NSWindow"/>
    146                                                         <reference key="NSNextKeyView" ref="1066788818"/>
    147136                                                        <bool key="NSEnabled">YES</bool>
    148137                                                        <object class="NSTextFieldCell" key="NSCell" id="830118733">
     
    171160                                        </array>
    172161                                        <string key="NSFrameSize">{400, 177}</string>
    173                                         <reference key="NSSuperview"/>
    174                                         <reference key="NSWindow"/>
    175                                         <reference key="NSNextKeyView" ref="459786882"/>
    176162                                </object>
    177163                                <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
     
    217203                                </object>
    218204                                <object class="IBConnectionRecord">
    219                                         <object class="IBOutletConnection" key="connection">
    220                                                 <string key="label">fCancelButton</string>
    221                                                 <reference key="source" ref="1001"/>
    222                                                 <reference key="destination" ref="9691643"/>
    223                                         </object>
    224                                         <int key="connectionID">22</int>
    225                                 </object>
    226                                 <object class="IBConnectionRecord">
    227205                                        <object class="IBActionConnection" key="connection">
    228206                                                <string key="label">openURLEndSheet:</string>
     
    230208                                                <reference key="destination" ref="794131740"/>
    231209                                        </object>
    232                                         <int key="connectionID">23</int>
     210                                        <int key="connectionID">18</int>
    233211                                </object>
    234212                                <object class="IBConnectionRecord">
     
    238216                                                <reference key="destination" ref="9691643"/>
    239217                                        </object>
    240                                         <int key="connectionID">24</int>
     218                                        <int key="connectionID">19</int>
    241219                                </object>
    242220                                <object class="IBConnectionRecord">
     
    247225                                        </object>
    248226                                        <int key="connectionID">21</int>
     227                                </object>
     228                                <object class="IBConnectionRecord">
     229                                        <object class="IBOutletConnection" key="connection">
     230                                                <string key="label">fCancelButton</string>
     231                                                <reference key="source" ref="1001"/>
     232                                                <reference key="destination" ref="9691643"/>
     233                                        </object>
     234                                        <int key="connectionID">22</int>
    249235                                </object>
    250236                        </array>
     
    369355                        <dictionary class="NSMutableDictionary" key="localizations"/>
    370356                        <nil key="sourceID"/>
    371                         <int key="maxID">24</int>
     357                        <int key="maxID">22</int>
    372358                </object>
    373359                <object class="IBClassDescriber" key="IBDocument.Classes">
     
    376362                                        <string key="className">URLSheetWindowController</string>
    377363                                        <string key="superclassName">NSWindowController</string>
    378                                         <dictionary class="NSMutableDictionary" key="actions">
    379                                                 <string key="openURLCancelEndSheet:">id</string>
    380                                                 <string key="openURLEndSheet:">id</string>
    381                                         </dictionary>
    382                                         <dictionary class="NSMutableDictionary" key="actionInfosByName">
    383                                                 <object class="IBActionInfo" key="openURLCancelEndSheet:">
    384                                                         <string key="name">openURLCancelEndSheet:</string>
    385                                                         <string key="candidateClassName">id</string>
    386                                                 </object>
    387                                                 <object class="IBActionInfo" key="openURLEndSheet:">
    388                                                         <string key="name">openURLEndSheet:</string>
    389                                                         <string key="candidateClassName">id</string>
    390                                                 </object>
    391                                         </dictionary>
    392364                                        <dictionary class="NSMutableDictionary" key="outlets">
    393365                                                <string key="fCancelButton">NSButton</string>
     
    429401                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
    430402                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
    431                         <real value="1070" key="NS.object.0"/>
     403                        <integer value="1060" key="NS.object.0"/>
    432404                </object>
    433405                <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
  • trunk/macosx/URLSheetWindowController.h

    r13248 r13251  
    3333    IBOutlet NSButton * fOpenButton, * fCancelButton;
    3434   
    35     __unsafe_unretained Controller * fController;
     35    Controller * fController;
    3636}
    3737
    3838- (id) initWithController: (Controller *) controller;
     39- (void) beginSheetForWindow: (NSWindow *) window;
    3940
    40 - (IBAction) openURLEndSheet: (id) sender;
    41 - (IBAction) openURLCancelEndSheet: (id) sender;
    42 
    43 - (NSString *) urlString;
     41- (void) openURLEndSheet: (id) sender;
     42- (void) openURLCancelEndSheet: (id) sender;
    4443
    4544@end
  • trunk/macosx/URLSheetWindowController.m

    r13248 r13251  
    8181}
    8282
    83 - (IBAction) openURLEndSheet: (id) sender
     83- (IBAction) beginSheetForWindow: (NSWindow *) window
     84{
     85    [NSApp beginSheet: [self window] modalForWindow: window modalDelegate: self
     86        didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) contextInfo: nil];
     87}
     88
     89- (void) openURLEndSheet: (id) sender
    8490{
    8591    [[self window] orderOut: sender];
     
    8793}
    8894
    89 - (IBAction) openURLCancelEndSheet: (id) sender
     95- (void) openURLCancelEndSheet: (id) sender
    9096{
    9197    [[self window] orderOut: sender];
     
    9399}
    94100
    95 - (NSString *) urlString
     101- (void) sheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
    96102{
    97     return [fTextField stringValue];
     103    [urlString release];
     104    urlString = [[fTextField stringValue] retain];
     105    [fController urlSheetDidEnd: self url: urlString returnCode: returnCode];
    98106}
    99107
Note: See TracChangeset for help on using the changeset viewer.