Fix a retain cycle through RuleContext.parent.
This refers back up the tree of RuleContext instances, and meant that the whole tree was leaked. Fix this by making the parent field weak.
This commit is contained in:
parent
64048caf12
commit
5885d54c25
|
@ -59,7 +59,7 @@ open class RuleContext: RuleNode {
|
|||
public static let EMPTY = ParserRuleContext()
|
||||
|
||||
/// What context invoked this rule?
|
||||
public var parent: RuleContext?
|
||||
public weak var parent: RuleContext?
|
||||
|
||||
/// What state invoked the rule associated with this context?
|
||||
/// The "return address" is the followState of invokingState
|
||||
|
|
Loading…
Reference in New Issue