diff --git a/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/V4MDPlugin.java b/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/V4MDPlugin.java index 1f211fa..53b3046 100644 --- a/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/V4MDPlugin.java +++ b/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/V4MDPlugin.java @@ -2,6 +2,7 @@ import com.incquerylabs.v4md.expressions.BinaryVQLExpression; import com.incquerylabs.v4md.internal.IProjectChangedListener; +import com.incquerylabs.v4md.transformations.IncrementalTransformationSynchronizer; import com.nomagic.ci.persistence.IProject; import com.nomagic.magicdraw.core.Application; import com.nomagic.magicdraw.core.Project; @@ -18,6 +19,7 @@ private final class V4MDProjectListener extends ProjectEventListenerAdapter impl @Override public void projectPreClosed(Project project) { // There is no need to explicitly initialize adapters; the dispose handles uninitialized adapters correctly + IncrementalTransformationSynchronizer.disposeSynchronizer(project); ViatraQueryAdapter.disposeAdapter(project); } diff --git a/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/transformations/IncrementalTransformationSynchronizer.java b/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/transformations/IncrementalTransformationSynchronizer.java index f9cde9f..048900c 100644 --- a/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/transformations/IncrementalTransformationSynchronizer.java +++ b/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/transformations/IncrementalTransformationSynchronizer.java @@ -56,6 +56,10 @@ private ViatraTransformationSynchronizerManager() { public ModelSynchronizer apply(Project t) { return (ModelSynchronizer) storage.computeIfAbsent(t, IncrementalTransformationSynchronizer::new); } + + } + public static void disposeSynchronizer(Project p) { + ((ViatraTransformationSynchronizerManager)FACTORY).storage.remove(p); } private BatchTransformation transformation;