From: Antti Villberg Date: Thu, 11 May 2017 09:24:22 +0000 (+0300) Subject: StyleBase runs cleanup in wrong thread X-Git-Tag: v1.29.0~62 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=a74b658406cde61563f7b08c935e831fdb043052;p=simantics%2Fplatform.git StyleBase runs cleanup in wrong thread refs #7206 Change-Id: I607539b6e5aabc947976308b972976ee97b9c4ea (cherry picked from commit d156f756b493ce0f853fcb5619809812ea764167) --- 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() {