]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCollectorImpl.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / QueryCollectorImpl.java
index 7bab1a77a9f6dbc60280e012a623566ddcb104e6..e6dc252c41f210d00586895aeabe6d7c619001f3 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
@@ -144,6 +148,7 @@ class QueryCollectorImpl implements QueryProcessor.QueryCollector {
                                                        
                                                } else {
                                                        
+                                                       entry.pruneParentSet();
                                                        support.setLevel(entry, parent.getLevel() + 1);
                                                        
                                                }