File tree 1 file changed +8
-2
lines changed
SDWebImageSwiftUI/Classes 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 {
73
73
public override init ( frame frameRect: CGRect ) {
74
74
super. init ( frame: frameRect)
75
75
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
+ }
77
80
self . invalidateIntrinsicContentSize ( )
78
81
}
79
82
}
80
83
81
84
public required init ? ( coder: NSCoder ) {
82
85
super. init ( coder: coder)
83
86
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
+ }
85
91
self . invalidateIntrinsicContentSize ( )
86
92
}
87
93
}
You can’t perform that action at this time.
0 commit comments