Skip to content

Image disposal removes ImageSource content event when directly passed to the component. #10625

Open
@boutier

Description

@boutier

Issue Description

On iOS, I have an ImageSource that I want to pass to some Image components:

<Image *ngIf="cond" [src]="myImageSource"></Image>
<Image *ngIf="otherCond" [src]="myImageSource"></Image>

But when Image is disposed, it clears the content of the provided ImageSource (this.imageSource.ios = null; ), which makes it not reusable!

public disposeImageSource() {
if (this.nativeViewProtected?.image === this.imageSource?.ios) {
this.nativeViewProtected.image = null;
}
if (this.imageSource?.ios) {
this.imageSource.ios = null;
}
this.imageSource = null;
queueGC();
}

Note that when src is an ImageSource, the _createImageSourceFromSrc function does not create but just use the provided ImageSource

} else if (value instanceof ImageSource) {
// Support binding the imageSource trough the src property
this.imageSource = value;
this.isLoading = false;

Reproduction

No response

Relevant log output (if applicable)

No response

Environment

No response

Please accept these terms

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy