File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
SDWebImageSwiftUI/Classes Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,21 @@ public class AnimatedImageViewWrapper : PlatformView {
7373 public override init ( frame frameRect: CGRect ) {
7474 super. init ( frame: frameRect)
7575 addSubview ( wrapped)
76- observation = observe ( \. wrapped. image, options: [ . new] ) { _, _ in
76+ observation = observe ( \. wrapped. image, options: [ . new] ) { [ weak self] _, _ in
77+ guard let self = self else {
78+ return
79+ }
7780 self . invalidateIntrinsicContentSize ( )
7881 }
7982 }
8083
8184 public required init ? ( coder: NSCoder ) {
8285 super. init ( coder: coder)
8386 addSubview ( wrapped)
84- observation = observe ( \. wrapped. image, options: [ . new] ) { _, _ in
87+ observation = observe ( \. wrapped. image, options: [ . new] ) { [ weak self] _, _ in
88+ guard let self = self else {
89+ return
90+ }
8591 self . invalidateIntrinsicContentSize ( )
8692 }
8793 }
You can’t perform that action at this time.
0 commit comments