You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m not at a computer right now so I can’t verify this, but it looks to me like your approach to handling forward references (using the Deferred class) might introduce a retain cycle.
My own Consumer library has a similiar design to yours, and I originally used a similar approach of using a class as a proxy for forward references, but I couldn’t find a way to break the cycle, because the parser enum is a value type.
One option is to wrap the parser enum in a class so it can be weakly referenced, but that seems like it would hurt performance, and it makes the API less elegant.
In the end I solved it by referencing using a string label instead of a pointer.
The text was updated successfully, but these errors were encountered:
I’m not at a computer right now so I can’t verify this, but it looks to me like your approach to handling forward references (using the Deferred class) might introduce a retain cycle.
My own Consumer library has a similiar design to yours, and I originally used a similar approach of using a class as a proxy for forward references, but I couldn’t find a way to break the cycle, because the parser enum is a value type.
One option is to wrap the parser enum in a class so it can be weakly referenced, but that seems like it would hurt performance, and it makes the API less elegant.
In the end I solved it by referencing using a string label instead of a pointer.
The text was updated successfully, but these errors were encountered: