From 4a2d5e0ab04119c571da0ec2d2289c71c55dc3f9 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Wed, 26 Feb 2020 00:24:19 +0200 Subject: [PATCH] Flush listener registrations before garbage collecting queries/listeners gitlab #481 Change-Id: I5aa5c3ef420faebba4a2c347cd999035bada675f --- .../src/org/simantics/db/impl/query/QueryCollectorImpl.java | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.47.1