Fix leak of LogicalState in Occurrence observers: properly terminate occ-s
This commit is contained in:
parent
ba8ccfce03
commit
bd25263eac
|
|
@ -65,11 +65,9 @@ class Occurrence (observable: LogicalStateObservable,
|
|||
override fun parentUpdated(logical: Logical<*>, controller: Controller) = doReactivate(controller)
|
||||
|
||||
fun terminate(observable: LogicalStateObservable) {
|
||||
if (alive) {
|
||||
for (a in arguments) {
|
||||
if (a is Logical<*>) {
|
||||
observable.removeForwardingObserver(a, this)
|
||||
}
|
||||
for (a in arguments) {
|
||||
if (a is Logical<*>) {
|
||||
observable.removeForwardingObserver(a, this)
|
||||
}
|
||||
}
|
||||
alive = false
|
||||
|
|
|
|||
|
|
@ -211,10 +211,10 @@ internal class EvaluationSessionImpl private constructor (
|
|||
val outputOccurrences = histView.filterOccurrences(inputStore)
|
||||
// todo: make output store in other processing strategies?
|
||||
|
||||
outputOccurrences.forEach{ it.terminate(logicalState) }
|
||||
processing.resetStore() // clear observers
|
||||
// todo: need clearing occurrenceContractObservers? (MPSCR-66)
|
||||
logicalState.reset()
|
||||
outputOccurrences.forEach{ it.terminate(logicalState) }
|
||||
|
||||
val rules = ruleIndex.toRules().filter(preambleInfo::inPreamble)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue