Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
13 changes: 8 additions & 5 deletions harmony/rn_webview/src/main/ets/Common.ets
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ export class myNodeController extends NodeController {
aboutToAppear() {
this.isMounted = true
this.getController()?.onActive()
Logger.debug("ljc aboutToAppear")
Logger.debug(" aboutToAppear")
}

// 当controller对应的NodeContainer在Disappear的时候进行回调
aboutToDisappear() {
this.isMounted = false
this.getController()?.onInactive()
Logger.debug("ljc aboutToDisappear")
this.release()
// this.isMounted = false
// this.getController()?.onInactive()
Logger.debug(" aboutToDisappear")
}

setMount(isMounted: boolean) {
Expand All @@ -127,7 +128,9 @@ export class myNodeController extends NodeController {
return controllerMap.get(this.id);
}

release(): void {
private release(): void {
this.getController()?.loadData('','text/html', 'UTF-8')
this.getController()?.clearHistory()
this.isMounted = false
this.getController()?.onInactive()
}
Expand Down
6 changes: 3 additions & 3 deletions harmony/rn_webview/src/main/ets/WebView.ets
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ export struct WebView {
} catch (error) {
Logger.error(TAG, `[RNOH]Errorcode: ${error.code}, Message: ${error.message}`);
}
if (this.webNodeId) {
getNWeb(this.webNodeId)?.release()
}
// if (this.webNodeId) {
// getNWeb(this.webNodeId)?.release()
// }
}

transCacheMode(cacheMode: number): CacheMode {
Expand Down