Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-02-13 15:50:13 +0000
committerJean Michel-Lemieux2002-02-13 15:50:13 +0000
commit09b93f509e01c249b939701b2c9b328e3746bb00 (patch)
tree57b73514453f000b15d0414b36dfa90028c1d590
parent939f4b0560feac5d43984acab57669a260859c2f (diff)
downloadeclipse.platform.team-09b93f509e01c249b939701b2c9b328e3746bb00.tar.gz
eclipse.platform.team-09b93f509e01c249b939701b2c9b328e3746bb00.tar.xz
eclipse.platform.team-09b93f509e01c249b939701b2c9b328e3746bb00.zip
Catching up to the new decorator support for calling dispose.
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
index bdd46b9db..bf52fc4cd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
@@ -31,6 +31,7 @@ import org.eclipse.team.core.IResourceStateChangeListener;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.CVSProvider;
+import org.eclipse.team.internal.ccvs.core.util.Assert;
/**
* Classes registered with the workbench decoration extension point. The <code>CVSDecorationRunnable</code> class
@@ -63,12 +64,15 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
private boolean shutdown = false;
public CVSDecorator() {
+ // The decorator is a singleton, there should never be more than one instance.
+ // temporary until the UI component properly calls dispose when the workbench shutsdown
+ // UI Bug 9633
+ Assert.isTrue(theDecorator==null);
+ theDecorator = this;
+
decoratorUpdateThread = new Thread(new CVSDecorationRunnable(this), "CVS"); //$NON-NLS-1$
decoratorUpdateThread.start();
TeamPlugin.getManager().addResourceStateChangeListener(this);
-
- // temporary until the UI component properly calls dispose on decorators
- theDecorator = this;
}
public String decorateText(String text, Object o) {
@@ -291,7 +295,9 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
}
public static void shutdownAll() {
- theDecorator.dispose();
+ if(theDecorator!=null) {
+ theDecorator.dispose();
+ }
}
public static String getFileTypeString(String name, String keyword) {
@@ -327,5 +333,6 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
decoratorNeedsUpdating.clear();
cache.clear();
+ theDecorator = null;
}
} \ No newline at end of file

Back to the top