Changeset 3140
- Timestamp:
- 02/17/06 01:31:16 (2 years ago)
- Files:
-
- branches/cocoa-networking/Chat Core/MVChatRoom.h (modified) (1 diff)
- branches/cocoa-networking/Chat Core/MVChatRoom.m (modified) (2 diffs)
- branches/cocoa-networking/Chat Core/MVIRCChatConnection.h (modified) (1 diff)
- branches/cocoa-networking/Chat Core/MVIRCChatConnection.m (modified) (4 diffs)
- branches/cocoa-networking/Chat Core/MVIRCChatUser.h (modified) (1 diff)
- branches/cocoa-networking/Chat Core/MVIRCChatUser.m (modified) (1 diff)
- branches/cocoa-networking/Chat Core/MVIRCFileTransfer.m (modified) (2 diffs)
- branches/cocoa-networking/Chat Core/MVSILCChatConnection.h (modified) (1 diff)
- branches/cocoa-networking/Chat Core/MVSILCChatConnection.m (modified) (2 diffs)
- branches/cocoa-networking/Chat Core/MVSILCChatUser.h (modified) (1 diff)
- branches/cocoa-networking/Chat Core/MVSILCChatUser.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cocoa-networking/Chat Core/MVChatRoom.h
r3128 r3140 62 62 unsigned long _modes; 63 63 unsigned int _hash; 64 BOOL _releasing; 64 65 } 65 66 - (MVChatConnection *) connection; branches/cocoa-networking/Chat Core/MVChatRoom.m
r3134 r3140 1 1 #import "MVChatConnection.h" 2 #import "MVChatConnectionPrivate.h" 2 3 #import "MVChatRoom.h" 3 4 #import "MVChatUser.h" … … 65 66 } 66 67 68 - (void) release { 69 if( ! _releasing && ( [self retainCount] - 1 ) == 1 ) { 70 _releasing = YES; 71 [[self connection] _removeJoinedRoom:self]; 72 } 73 74 [super release]; 75 } 76 67 77 - (void) dealloc { 68 78 [_name release]; branches/cocoa-networking/Chat Core/MVIRCChatConnection.h
r3131 r3140 43 43 - (void) _removeFileTransfer:(MVFileTransfer *) transfer; 44 44 45 - (void) _removeKnownUser:(MVChatUser *) user; 46 45 47 - (void) _setCurrentNickname:(NSString *) nickname; 46 48 @end branches/cocoa-networking/Chat Core/MVIRCChatConnection.m
r3138 r3140 572 572 _connectionThread = nil; 573 573 574 [pool drain]; 574 575 [pool release]; 575 576 } … … 897 898 @synchronized( _fileTransfers ) { 898 899 if( transfer ) [_fileTransfers removeObject:transfer]; 900 } 901 } 902 903 #pragma mark - 904 905 - (void) _removeKnownUser:(MVChatUser *) user { 906 @synchronized( _knownUsers ) { 907 if( user ) [_knownUsers removeObjectForKey:[user uniqueIdentifier]]; 899 908 } 900 909 } … … 1213 1222 room = [[MVIRCChatRoom allocWithZone:nil] initWithName:name andConnection:self]; 1214 1223 [self _addJoinedRoom:room]; 1215 [room release]; 1216 } 1224 } else [room retain]; 1217 1225 1218 1226 [room _setDateJoined:[NSDate date]]; … … 1554 1562 [room _setNamesSynced:YES]; 1555 1563 [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:MVChatRoomJoinedNotification object:room]; 1564 [room release]; // balance the alloc or retain from _handleJoinWithParameters 1556 1565 } 1557 1566 } branches/cocoa-networking/Chat Core/MVIRCChatUser.h
r3081 r3140 4 4 @class MVIRCChatConnection; 5 5 6 @interface MVIRCChatUser : MVChatUser {} 6 @interface MVIRCChatUser : MVChatUser { 7 BOOL _releasing; 8 } 7 9 - (id) initLocalUserWithConnection:(MVIRCChatConnection *) connection; 8 10 - (id) initWithNickname:(NSString *) nickname andConnection:(MVIRCChatConnection *) connection; branches/cocoa-networking/Chat Core/MVIRCChatUser.m
r3134 r3140 27 27 [[NSNotificationCenter defaultCenter] removeObserver:self]; 28 28 [super finalize]; 29 } 30 31 - (void) release { 32 if( ! _releasing && [self isRemoteUser] && ( [self retainCount] - 1 ) == 1 ) { 33 _releasing = YES; 34 [[self connection] _removeKnownUser:self]; 35 } 36 37 [super release]; 29 38 } 30 39 branches/cocoa-networking/Chat Core/MVIRCFileTransfer.m
r3134 r3140 353 353 _connectionThread = nil; 354 354 355 [pool drain]; 355 356 [pool release]; 356 357 } … … 597 598 _connectionThread = nil; 598 599 600 [pool drain]; 599 601 [pool release]; 600 602 } branches/cocoa-networking/Chat Core/MVSILCChatConnection.h
r3081 r3140 52 52 - (NSMutableDictionary *) _sentCommands; 53 53 54 - (void) _removeKnownUser:(MVChatUser *) user; 55 54 56 - (NSData *) _detachInfo; 55 57 - (void) _setDetachInfo:(NSData *) info; branches/cocoa-networking/Chat Core/MVSILCChatConnection.m
r3134 r3140 1382 1382 pool = [[NSAutoreleasePool allocWithZone:nil] init]; 1383 1383 silc_schedule_one( _silcClient -> schedule, -1 ); 1384 [pool drain]; 1384 1385 [pool release]; 1385 1386 } … … 1470 1471 - (NSMutableDictionary *) _sentCommands { 1471 1472 return _sentCommands; 1473 } 1474 1475 #pragma mark - 1476 1477 - (void) _removeKnownUser:(MVChatUser *) user { 1478 @synchronized( _knownUsers ) { 1479 if( user ) [_knownUsers removeObjectForKey:[user uniqueIdentifier]]; 1480 } 1472 1481 } 1473 1482 branches/cocoa-networking/Chat Core/MVSILCChatUser.h
r3081 r3140 8 8 @interface MVSILCChatUser : MVChatUser { 9 9 SilcClientEntry _clientEntry; 10 BOOL _releasing; 10 11 } 11 12 - (id) initLocalUserWithConnection:(MVSILCChatConnection *) connection; branches/cocoa-networking/Chat Core/MVSILCChatUser.m
r3134 r3140 28 28 29 29 return self; 30 } 31 32 - (void) release { 33 if( ! _releasing && [self isRemoteUser] && ( [self retainCount] - 1 ) == 1 ) { 34 _releasing = YES; 35 [[self connection] _removeKnownUser:self]; 36 } 37 38 [super release]; 30 39 } 31 40
