1.1 --- a/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManager.m Mon Apr 06 08:08:22 2009 +0000
1.2 +++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManager.m Sat Oct 31 12:31:33 2009 -0500
1.3 @@ -42,6 +42,23 @@
1.4 contacts = [[NSMutableDictionary alloc] init];
1.5 client = newClient;
1.6 isConnected = NO;
1.7 +
1.8 + /* find username and computer name */
1.9 + CFStringRef consoleUser = SCDynamicStoreCopyConsoleUser(NULL, NULL, NULL);
1.10 + CFStringRef computerName = SCDynamicStoreCopyLocalHostName(NULL);
1.11 + if (!computerName) {
1.12 + /* computerName can return NULL if the computer name is not set or an error occurs */
1.13 + CFUUIDRef uuid;
1.14 +
1.15 + uuid = CFUUIDCreate(NULL);
1.16 + computerName = CFUUIDCreateString(NULL, uuid);
1.17 + CFRelease(uuid);
1.18 + }
1.19 + avInstanceName = [[NSString alloc] initWithFormat:@"%@@%@",
1.20 + (consoleUser ? (NSString *)consoleUser : @""),
1.21 + (computerName ? (NSString *)computerName : @"")];
1.22 + if (consoleUser) CFRelease(consoleUser);
1.23 + if (computerName) CFRelease(computerName);
1.24 }
1.25
1.26 return self;
1.27 @@ -71,7 +88,9 @@
1.28 - (void)dealloc {
1.29 /* AWEzvContactManagerListener adds an observer; remove it */
1.30 [[NSNotificationCenter defaultCenter] removeObserver:self];
1.31 - [userAnnounceData release];
1.32 +
1.33 + [userAnnounceData release]; userAnnounceData = nil;
1.34 + [avInstanceName release]; avInstanceName = nil;
1.35
1.36 [super dealloc];
1.37 }