mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(core): provided image source can be unintentionally disposed (#10654)
This commit is contained in:
committed by
GitHub
parent
050fa3fea6
commit
a883a79e3b
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user