Flush listener registrations before garbage collecting queries/listeners 11/3911/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 25 Feb 2020 22:24:19 +0000 (00:24 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 25 Feb 2020 22:24:19 +0000 (00:24 +0200)
gitlab #481

Change-Id: I5aa5c3ef420faebba4a2c347cd999035bada675f

bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCollectorImpl.java

index 7bab1a77a9f6dbc60280e012a623566ddcb104e6..0b6f6ef834411316255ac12e80f56faa3d3bdd93 100644 (file)
@@ -42,6 +42,10 @@ class QueryCollectorImpl implements QueryProcessor.QueryCollector {
        @Override
        public void collect(int youngTarget, int allowedTimeInMs) {
 
+               // Flush listener registrations to prevent the collector from trashing
+               // listeners that are still queued up waiting to be registered.
+               queryProcessor.listening.sync();
+
                long start = System.nanoTime();
 
                // Refresh current size