adium 4492:c3f51cbb02e0: Chats can no longer refuse to quit when...
commits at adium.im
commits at adium.im
Wed Jan 11 17:30:19 UTC 2012
details: http://hg.adium.im/adium/rev/c3f51cbb02e0
revision: 4492:c3f51cbb02e0
branch: (none)
author: Thijs Alkemade <thijsalkemade at gmail.com>
date: Wed Jan 11 18:29:29 2012 +0100
Chats can no longer refuse to quit when they're still processing content. The user won't see the content anyway, and they would make Adium freeze.
Even if the content wasn't completely stuck (but in a delayed content filter, for example), because this works as a busy wait, it would never finish processing.
diffs (29 lines):
diff -r 6bfad1569583 -r c3f51cbb02e0 Source/AIChatController.m
--- a/Source/AIChatController.m Tue Jan 10 20:12:10 2012 +0100
+++ b/Source/AIChatController.m Wed Jan 11 18:29:29 2012 +0100
@@ -140,8 +140,24 @@
- (void)adiumWillTerminate:(NSNotification *)inNotification
{
//Every open chat is about to close. We perform the internal closing here rather than calling on the interface controller since the UI need not change.
+ //Also, we don't care for still processing content, the user won't see it anyway, and it can make Adium refuse to quit.
while ([openChats count] > 0) {
- [self closeChat:[openChats anyObject]];
+ AIChat *chat = [[openChats anyObject] retain];
+
+ if (mostRecentChat == chat) {
+ [mostRecentChat release];
+ mostRecentChat = nil;
+ }
+
+ //Send out the Chat_WillClose notification
+ [[NSNotificationCenter defaultCenter] postNotificationName:Chat_WillClose object:chat userInfo:nil];
+
+ [chat.account closeChat:chat];
+ [openChats removeObject:chat];
+ AILogWithSignature(@"Removed <<%@>> [%@]", chat, openChats);
+
+ [chat setIsOpen:NO];
+ [chat release];
}
}
More information about the commits
mailing list