-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix retain cycle(s) in encoder implementation #220
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One change to make then we're good
@@ -136,8 +136,9 @@ extension LeafEncoder { | |||
} | |||
|
|||
private final class KeyedContainerImpl<Key>: KeyedEncodingContainerProtocol, LeafEncodingResolvable where Key: CodingKey { | |||
private let encoder: EncoderImpl | |||
private weak var encoder: EncoderImpl! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this optional since we unwrap it anyway. That provides a fatal error with a message rather than just crashing (and won't complain when we roll out swiftlint)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested changes so I can merge them in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why you don't code on your phone
Will merge as is and we can fix the IUOs in a future PR. Since this has been running with a real site I'm happy to merge |
These changes are now available in 4.2.3 |
@petrpavlik @0xTim Thanks so much for fixing this. |
This PR addresses issue #215 and server as an alternative of PR #216, that somehow got stuck in it's efforts of being merged in.
I've done 2 things to discover the issue and confirm the fix