fix(core): provided image source can be unintentionally disposed (#10654)

This commit is contained in:
Dimitris-Rafail Katsampas
2025-01-13 04:12:06 +02:00
committed by GitHub
parent 050fa3fea6
commit a883a79e3b
4 changed files with 32 additions and 15 deletions

View File

@@ -125,7 +125,9 @@ export abstract class ImageBase extends View implements ImageDefinition {
}
} else if (value instanceof ImageSource) {
// Support binding the imageSource trough the src property
this.imageSource = value;
// This will help avoid cleanup on the actual provided image source in case view gets disposed
this.imageSource = new ImageSource(value.getNativeSource());
this.isLoading = false;
} else if (value instanceof ImageAsset) {
ImageSource.fromAsset(value).then((result) => {