diff --git a/Sources/Leaf/LeafEncoder.swift b/Sources/Leaf/LeafEncoder.swift index 2584769..343ffb4 100644 --- a/Sources/Leaf/LeafEncoder.swift +++ b/Sources/Leaf/LeafEncoder.swift @@ -136,7 +136,7 @@ extension LeafEncoder { } private final class KeyedContainerImpl: KeyedEncodingContainerProtocol, LeafEncodingResolvable where Key: CodingKey { - private let encoder: EncoderImpl + private weak var encoder: EncoderImpl! private var data: [String: LeafEncodingResolvable] = [:] /// See ``LeafEncodingResolvable/resolvedData``. @@ -197,7 +197,7 @@ extension LeafEncoder { } private final class UnkeyedContainerImpl: UnkeyedEncodingContainer, LeafEncodingResolvable { - private let encoder: EncoderImpl + private weak var encoder: EncoderImpl! private var data: [LeafEncodingResolvable] = [] /// See ``LeafEncodingResolvable/resolvedData``.