]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java
AsyncBarrier.dec runs into refcounting problem
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / State.java
index 4c6e77b1a94729c0274078ef5318ffcf30a51f36..1e468f2c3f25e2e3e50cc6487fc02e57d3a7017e 100644 (file)
@@ -24,6 +24,7 @@ import org.simantics.db.common.utils.Logger;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.exception.InternalException;
 import org.simantics.db.exception.RuntimeDatabaseException;
+import org.simantics.db.impl.graph.ReadGraphImpl;
 import org.simantics.db.impl.graph.WriteGraphImpl;
 import org.simantics.db.impl.query.QueryProcessor;
 import org.simantics.db.request.WriteOnly;
@@ -340,7 +341,10 @@ class State {
 
 //                start = System.nanoTime();
                 queryProvider.propagateChangesInQueryCache(graph);
-                queryProvider.listening.fireListeners(graph);
+                ReadGraphImpl listenerGraph = graph.forRecompute(null);
+                listenerGraph.asyncBarrier.inc();
+                queryProvider.listening.fireListeners(listenerGraph);
+                listenerGraph.asyncBarrier.dec();
 //                duration = System.nanoTime() - start;
 //                System.out.println("performScheduledUpdates " + 1e-9*duration + "s. ");