Changeset 3325


Ignore:
Timestamp:
Oct 8, 2007, 4:15:25 AM (15 years ago)
Author:
livings124
Message:

ensure everything is deallocated properly on quit, libtransmission is closed properly, and inspector window height is remembered

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r3315 r3325  
    183183}
    184184
    185 - (void) dealloc
    186 {
    187     [[NSNotificationCenter defaultCenter] removeObserver: self];
    188    
    189     [fInfoController release];
    190     [fMessageController release];
    191     [fPrefsController release];
    192    
    193     [fTorrents release];
    194     [fDisplayedTorrents release];
    195    
    196     [fBadger release];
    197     [fOverlayWindow release];
    198     [fIPCController release];
    199    
    200     [fAutoImportedNames release];
    201     [fPendingTorrentDownloads release];
    202     [fTempTorrentFiles release];
    203    
    204     tr_close(fLib);
    205     [super dealloc];
    206 }
    207 
    208185- (void) awakeFromNib
    209186{
     
    609586            && (tr_torrentCount(fLib) > 0 || tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED))
    610587        usleep(100000);
     588   
     589    //remaining calls the same as dealloc
     590    [[NSNotificationCenter defaultCenter] removeObserver: self];
     591   
     592    [fInfoController release];
     593    [fMessageController release];
     594    [fPrefsController release];
     595   
     596    [fTorrents release];
     597    [fDisplayedTorrents release];
     598   
     599    [fBadger release];
     600    [fOverlayWindow release];
     601    [fIPCController release];
     602   
     603    [fAutoImportedNames release];
     604    [fPendingTorrentDownloads release];
     605    [fTempTorrentFiles release];
     606   
     607    tr_close(fLib);
    611608}
    612609
  • trunk/macosx/InfoWindowController.m

    r3324 r3325  
    160160- (void) dealloc
    161161{
    162     #warning not called?
    163     float viewHeight = [[self tabViewForTag: fCurrentTabTag] frame].size.height;
    164    
    165162    //save resizeable view height
    166163    if (fCurrentTabTag == TAB_PEERS_TAG || fCurrentTabTag == TAB_FILES_TAG)
    167         [[NSUserDefaults standardUserDefaults] setFloat: viewHeight forKey: @"InspectorContentHeight"];
     164        [[NSUserDefaults standardUserDefaults] setFloat: [[self tabViewForTag: fCurrentTabTag] frame].size.height
     165            forKey: @"InspectorContentHeight"];
    168166   
    169167    [[NSNotificationCenter defaultCenter] removeObserver: self];
     
    200198        else
    201199        {
    202             [fNameField setStringValue: NSLocalizedString(@"No Torrents Selected",
    203                                                             "Inspector -> above tabs -> selected torrents")];
     200            [fNameField setStringValue: NSLocalizedString(@"No Torrents Selected", "Inspector -> above tabs -> selected torrents")];
    204201            [fSizeField setStringValue: @""];
    205202   
Note: See TracChangeset for help on using the changeset viewer.