Changeset 3141

Show
Ignore:
Timestamp:
02/17/06 01:34:15 (3 years ago)
Author:
timothy
Message:

Prevent a possible loop when releasing transfers.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cocoa-networking/Chat Core/MVIRCFileTransfer.h

    r3131 r3141  
    1414        BOOL _doneSending; 
    1515        BOOL _done; 
     16        BOOL _releasing; 
    1617        unsigned int _passiveId; 
    1718} 
     
    3334        BOOL _done; 
    3435        BOOL _turbo; 
     36        BOOL _releasing; 
    3537        unsigned int _passiveId; 
    3638} 
  • branches/cocoa-networking/Chat Core/MVIRCFileTransfer.m

    r3140 r3141  
    157157 
    158158- (void) release { 
    159         if( ( [self retainCount] - 1 ) == 1 ) 
     159        if( ! _releasing && ( [self retainCount] - 1 ) == 1 ) { 
     160                _releasing = YES; 
    160161                [(MVIRCChatConnection *)[[self user] connection] _removeFileTransfer:self]; 
     162        } 
     163 
    161164        [super release]; 
    162165} 
     
    384387 
    385388- (void) release { 
    386         if( ( [self retainCount] - 1 ) == 1 ) 
     389        if( ! _releasing && ( [self retainCount] - 1 ) == 1 ) { 
     390                _releasing = YES; 
    387391                [(MVIRCChatConnection *)[[self user] connection] _removeFileTransfer:self]; 
     392        } 
     393 
    388394        [super release]; 
    389395}