Fix a ConcurrentModificationException when closing multiple chat tabs in one click.

cusax-fix
Valentin Martinet 17 years ago
parent cf7a4382a3
commit 86107ceec6

@ -250,30 +250,32 @@ void closeWindow(ChatWindow chatWindow)
synchronized (syncChat)
{
ChatPanel activePanel = null;
for (ChatPanel chatPanel : chatPanels)
synchronized (chatPanels)
{
if (chatPanel.getChatSession() instanceof
AdHocConferenceChatSession)
{
AdHocConferenceChatSession adHocSession
= (AdHocConferenceChatSession) chatPanel
.getChatSession();
GuiActivator.getUIService().getConferenceChatManager()
.leaveChatRoom(
(AdHocChatRoomWrapper) adHocSession.getDescriptor());
}
if (!chatPanel.isWriteAreaEmpty()
|| chatPanel.containsActiveFileTransfers()
|| System.currentTimeMillis() - chatWindow
.getLastIncomingMsgTimestamp(chatPanel) < 2 * 1000)
{
activePanel = chatPanel;
}
for (ChatPanel chatPanel : chatPanels)
{
if (chatPanel.getChatSession() instanceof
AdHocConferenceChatSession)
{
AdHocConferenceChatSession adHocSession
= (AdHocConferenceChatSession) chatPanel
.getChatSession();
GuiActivator.getUIService().getConferenceChatManager()
.leaveChatRoom((AdHocChatRoomWrapper)
adHocSession.getDescriptor());
}
if (!chatPanel.isWriteAreaEmpty()
|| chatPanel.containsActiveFileTransfers()
|| System.currentTimeMillis() - chatWindow
.getLastIncomingMsgTimestamp(chatPanel) < 2 * 1000)
{
activePanel = chatPanel;
}
}
}
if (activePanel == null)
{
this.disposeChatWindow(chatWindow);

Loading…
Cancel
Save