Changeset 6047


Ignore:
Timestamp:
Jun 5, 2008, 5:00:24 AM (14 years ago)
Author:
livings124
Message:

avoid unnecessary memory allocation when updating the rpc access list

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r6045 r6047  
    22762276        NSString * groupName = groupIndex != -1 ? [[GroupsController groups] nameForIndex: groupIndex]
    22772277                                                : NSLocalizedString(@"None", "Groups -> Button");
    2278         toolTip = [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Group", "Groups -> Button"), groupName];
     2278        toolTip = [NSLocalizedString(@"Group", "Groups -> Button") stringByAppendingFormat: @": %@", groupName];
    22792279    }
    22802280   
  • trunk/macosx/InfoWindowController.m

    r6009 r6047  
    843843    if ([notification object] == fTrackerTable)
    844844    {
    845         #warning disable when all selected
    846845        int numSelected = [fTrackerTable numberOfSelectedRows];
    847846        [fTrackerAddRemoveControl setEnabled: numSelected > 0 forSegment: TRACKER_REMOVE_TAG];
  • trunk/macosx/PrefsController.m

    r6034 r6047  
    672672    NSString * string = [components componentsJoinedByString: @","];
    673673   
    674     char ** error = (char **)tr_malloc(sizeof(char **));
    675     if (tr_sessionSetRPCACL(fHandle, [string UTF8String], error))
    676     {
    677         NSLog([NSString stringWithUTF8String: *error]);
    678         tr_free(*error);
    679     }
    680     tr_free(error);
     674    char * error = NULL;
     675    if (tr_sessionSetRPCACL(fHandle, [string UTF8String], &error))
     676    {
     677        NSLog([NSString stringWithUTF8String: error]);
     678        tr_free(error);
     679    }
    681680}
    682681
  • trunk/macosx/Torrent.m

    r6019 r6047  
    5353- (NSString *) etaString: (int) eta;
    5454
    55 - (BOOL) updateAllTrackers: (NSMutableArray *) trackers;
     55- (void) updateAllTrackers: (NSMutableArray *) trackers;
    5656
    5757- (void) trashFile: (NSString *) path;
     
    814814        return NO;
    815815   
     816    [self updateAllTrackers: trackers];
     817   
    816818    fAddedTrackers = YES;
    817    
    818     return [self updateAllTrackers: trackers];
     819    return YES;
    819820}
    820821
    821822- (BOOL) updateAllTrackersForRemove: (NSMutableArray *) trackers
    822823{
    823     //check if any user-added groups
     824    //check if no user-added groups
    824825    if ([[trackers objectAtIndex: 0] intValue] != 0)
    825826        fAddedTrackers = NO;
    826827   
    827     return [self updateAllTrackers: trackers];
     828    [self updateAllTrackers: trackers];
     829   
     830    return YES;
    828831}
    829832
     
    18831886}
    18841887
    1885 - (BOOL) updateAllTrackers: (NSMutableArray *) trackers
     1888- (void) updateAllTrackers: (NSMutableArray *) trackers
    18861889{
    18871890    //get count
     
    19121915    tr_torrentSetAnnounceList(fHandle, trackerStructs, count);
    19131916    tr_free(trackerStructs);
    1914    
    1915     return YES;
    19161917}
    19171918
Note: See TracChangeset for help on using the changeset viewer.