Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ - (void)_setStateAndResubscribeImageResponseObserver:(const ImageShadowNode::Con
observerCoordinator.removeObserver(_imageResponseObserverProxy);
}

// Release the previous image to prevent memory accumulation
// when the source prop changes rapidly (e.g., in animations/slideshows).
// The UIImageView retains the UIImage, preventing deallocation until
// the next image arrives, which can cause significant memory growth.
_imageView.image = nil;

_state = state;
Comment on lines +143 to 149

if (_state) {
Expand Down Expand Up @@ -301,4 +307,4 @@ - (void)didReceiveFailure:(NSError *)error fromObserver:(const void *)observer
Class<RCTComponentViewProtocol> RCTImageCls(void)
{
return RCTImageComponentView.class;
}
}
Loading