Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java
index f82f2c25f..caecfc274 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java
@@ -11,19 +11,23 @@
package org.eclipse.ui.externaltools.internal.model;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.Map;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.core.runtime.Assert;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
/**
* A registry that maps <code>ImageDescriptors</code> to <code>Image</code>.
*/
public class ImageDescriptorRegistry {
- private HashMap<ImageDescriptor, Image> fRegistry = new HashMap<ImageDescriptor, Image>(10);
+ private Map<ImageDescriptor, Image> fRegistry = Collections.synchronizedMap(new HashMap<ImageDescriptor, Image>(10));
private Display fDisplay;
/**
@@ -78,10 +82,16 @@ public class ImageDescriptorRegistry {
}
private void hookDisplay() {
- fDisplay.disposeExec(new Runnable() {
+ fDisplay.asyncExec(new Runnable() {
@Override
public void run() {
- dispose();
+ fDisplay.disposeExec(new Runnable() {
+
+ @Override
+ public void run() {
+ dispose();
+ }
+ });
}
});
}

Back to the top