aboutToRecycle生命周期将请求生命周期销毁

Signed-off-by: zenggaofeng <zenggaofeng2@h-partners.com>
This commit is contained in:
zenggaofeng 2024-04-23 20:06:22 +08:00
parent 5d21da6dac
commit d152713556
1 changed files with 6 additions and 1 deletions

View File

@ -63,7 +63,12 @@ export struct ImageKnifeComponent {
}
this.listener.off("layout", this.onLayoutComplete)
}
aboutToRecycle(){
if (this.request !== undefined) {
this.request.requestState = ImageKnifeRequestState.DESTROY
this.request = undefined
}
}
build() {
Image(this.pixelMap)
.objectFit(this.ImageKnifeOption.objectFit === undefined ? ImageFit.Contain : this.ImageKnifeOption.objectFit)