Closed dreampiggy closed 1 year ago
Try using the demo code, function works as expected.
Merging #180 (d175c0d) into master (cd8625b) will increase coverage by
0.20%
. The diff coverage is50.00%
.
@@ Coverage Diff @@
## master #180 +/- ##
==========================================
+ Coverage 74.81% 75.02% +0.20%
==========================================
Files 11 11
Lines 969 965 -4
==========================================
- Hits 725 724 -1
+ Misses 244 241 -3
Flag | Coverage Δ | |
---|---|---|
ios | 71.11% <50.00%> (+0.20%) |
:arrow_up: |
macos | 75.77% <50.00%> (+0.23%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
SDWebImageSwiftUI/Classes/WebImage.swift | 87.97% <20.00%> (-1.47%) |
:arrow_down: |
SDWebImageSwiftUI/Classes/ImageManager.swift | 84.00% <100.00%> (+8.56%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update cd8625b...d175c0d. Read the comment docs.
This may solve #176
The callstack trace shows that UIHostingView's
dealloc
method will trigger the View'sonDisappear
method. And it use the unownded but not weak for the internal storage. If we trigger anotherbody
refreshing call from the Publisher (in the #176 is because of theImageManager.isLoading
property), this will cause the crash because the internal storage already been destroyed.Instead, I try to avoid setting
isLoading
insidecancel
. Tthis property is previouslly used to supports thedelayPlaceholder
feature.delayPlaceholder
in SDWebImage means:So, instead I use the
error
to check whether there are loading failure. This can keep this function as well.