From: Tuukka Lehtonen Date: Tue, 25 Feb 2020 22:24:19 +0000 (+0200) Subject: Flush listener registrations before garbage collecting queries/listeners X-Git-Tag: v1.43.0~79 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=4a2d5e0ab04119c571da0ec2d2289c71c55dc3f9;p=simantics%2Fplatform.git Flush listener registrations before garbage collecting queries/listeners gitlab #481 Change-Id: I5aa5c3ef420faebba4a2c347cd999035bada675f --- diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCollectorImpl.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCollectorImpl.java index 7bab1a77a..0b6f6ef83 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCollectorImpl.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCollectorImpl.java @@ -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