Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-09-06 04:36:26 +0000
committerslewis2005-09-06 04:36:26 +0000
commit3edc6cc719454b20493dc9784e081a293027a366 (patch)
tree9930ebca3653ff109bb95683f39182913cdebdf0 /framework/bundles/org.eclipse.ecf.ui/src
parent9a2563dc197582b5807895a8293ebbb3fcfcac36 (diff)
downloadorg.eclipse.ecf-3edc6cc719454b20493dc9784e081a293027a366.tar.gz
org.eclipse.ecf-3edc6cc719454b20493dc9784e081a293027a366.tar.xz
org.eclipse.ecf-3edc6cc719454b20493dc9784e081a293027a366.zip
Fixed bug in handling of view disposal
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.ui/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/ChatRoomView.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/ChatRoomView.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/ChatRoomView.java
index 20769bcbd..9ecff7642 100644
--- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/ChatRoomView.java
+++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/ChatRoomView.java
@@ -83,6 +83,8 @@ public class ChatRoomView extends ViewPart implements IMessageListener, IPartici
Action outputPaste = null;
Action outputSelectAll = null;
+ boolean disposed = false;
+
private Color colorFromRGBString(String rgb) {
Color color = null;
if (rgb == null || rgb.equals("")) {
@@ -216,6 +218,9 @@ public class ChatRoomView extends ViewPart implements IMessageListener, IPartici
closeListener = null;
viewID = null;
}
+ otherUsers.clear();
+ localUser = null;
+ disposed = true;
super.dispose();
}
protected String getMessageString(ID fromID, String text) {
@@ -224,6 +229,7 @@ public class ChatRoomView extends ViewPart implements IMessageListener, IPartici
public void handleMessage(final ID fromID, final ID toID, final Type type, final String subject, final String messageBody) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
+ if (disposed) return;
appendText(new ChatLine(messageBody,new Participant(fromID)));
}
});
@@ -300,6 +306,7 @@ public class ChatRoomView extends ViewPart implements IMessageListener, IPartici
public void handlePresence(final ID fromID, final IPresence presence) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
+ if (disposed) return;
boolean isAdd = presence.getType().equals(IPresence.Type.AVAILABLE);
Participant p = new Participant(fromID);
if (isAdd) {
@@ -404,10 +411,12 @@ public class ChatRoomView extends ViewPart implements IMessageListener, IPartici
}
public void handleJoin(ID user) {
+ if (disposed) return;
otherUsers.add(user);
}
public void handleLeave(ID user) {
+ if (disposed) return;
otherUsers.remove(user);
}

Back to the top