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:
Ewan Mellor 2017-10-23 18:00:10 -07:00
parent 64048caf12
commit 5885d54c25
No known key found for this signature in database
GPG Key ID: 7CE1C6BC9EC8645D
1 changed files with 1 additions and 1 deletions

View File

@ -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