Commit a38496a
committed
fix(iOS): release previous UIImage on source prop change to prevent memory leak
When the Image component's source prop changes, the UIImageView retains
the previous UIImage until the new image loads. On rapid source changes
(e.g., image carousels, animations), this causes memory accumulation
since old images are not released promptly.
Explicitly setting _imageView.image = nil in
_setStateAndResubscribeImageResponseObserver: ensures the previous
UIImage is released when the state (and thus source) changes,
preventing unbounded memory growth.
Fixes #122201 parent 510cc0c commit a38496a
1 file changed
Lines changed: 7 additions & 1 deletion
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
| |||
301 | 307 | | |
302 | 308 | | |
303 | 309 | | |
304 | | - | |
| 310 | + | |
0 commit comments