From: Antti Villberg Date: Thu, 11 May 2017 09:24:22 +0000 (+0300) Subject: StyleBase runs cleanup in wrong thread X-Git-Tag: v1.28.0~15 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F501%2F1;p=simantics%2Fplatform.git StyleBase runs cleanup in wrong thread refs #7206 Change-Id: I607539b6e5aabc947976308b972976ee97b9c4ea --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java index 5aed90b48..ee203616d 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/StyleBase.java @@ -457,7 +457,11 @@ public abstract class StyleBase implements Style { * @param items the diagram data items that need to be cleaned up */ protected final void cleanupItems(final EvaluationContext evaluationContext, final IDiagram diagram, final Object[] items) { - AWTThread.getThreadAccess().asyncExec(new Runnable() { + + ICanvasContext context = evaluationContext.getConstant(ProfileKeys.CANVAS); + + context.getThreadAccess().asyncExec(new Runnable() { + @Override public void run() {