Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-03-26 12:51:25 -0400
committerChristian W. Damus2014-03-26 12:54:11 -0400
commit00d1c880696cd9b9b88655d064c1aba3cf5b0502 (patch)
tree5a97c4df64c982c9d3c453d3a458b6de6859f8a3 /plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration
parentdaf1ce4231cd258c03c6922978d2db80707cfae2 (diff)
downloadorg.eclipse.papyrus-00d1c880696cd9b9b88655d064c1aba3cf5b0502.tar.gz
org.eclipse.papyrus-00d1c880696cd9b9b88655d064c1aba3cf5b0502.tar.xz
org.eclipse.papyrus-00d1c880696cd9b9b88655d064c1aba3cf5b0502.zip
392301: Colors are leaked
https://bugs.eclipse.org/bugs/show_bug.cgi?id=392301 Fix leaked SWT colours by caching frequently-used colours (especially for gradients) in GMF's ColorRegistry, which in GMF also is used for gradient painting.
Diffstat (limited to 'plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleDialog.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleDialog.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleDialog.java
index d377eadece7..1129c431c78 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleDialog.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleDialog.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
+ * Copyright (c) 2012, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 392301
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.configuration.handler;
@@ -17,7 +19,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.draw2d.ui.graphics.ColorRegistry;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TrayDialog;
@@ -396,7 +398,7 @@ public abstract class AbstractStyleDialog extends TrayDialog {
protected Color getColor(HexColor color) {
RGBColor rgbColor = CSS2ColorHelper.getRGBColor("#" + color.getValue());
int intColor = ColorToGMFConverter.getIntColor(rgbColor);
- return FigureUtilities.integerToColor(intColor);
+ return ColorRegistry.getInstance().getColor(intColor);
}
public String getCSSClass() {

Back to the top