This repository was archived by the owner on Nov 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
harmony/rn_webview/src/main/ets Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -105,14 +105,15 @@ export class myNodeController extends NodeController {
105105 aboutToAppear() {
106106 this.isMounted = true
107107 this.getController()?.onActive()
108- Logger.debug("ljc aboutToAppear")
108+ Logger.debug(" aboutToAppear")
109109 }
110110
111111 // 当controller对应的NodeContainer在Disappear的时候进行回调
112112 aboutToDisappear() {
113- this.isMounted = false
114- this.getController()?.onInactive()
115- Logger.debug("ljc aboutToDisappear")
113+ this.release()
114+ // this.isMounted = false
115+ // this.getController()?.onInactive()
116+ Logger.debug(" aboutToDisappear")
116117 }
117118
118119 setMount(isMounted: boolean) {
@@ -127,7 +128,9 @@ export class myNodeController extends NodeController {
127128 return controllerMap.get(this.id);
128129 }
129130
130- release(): void {
131+ private release(): void {
132+ this.getController()?.loadData('','text/html', 'UTF-8')
133+ this.getController()?.clearHistory()
131134 this.isMounted = false
132135 this.getController()?.onInactive()
133136 }
Original file line number Diff line number Diff line change @@ -367,9 +367,9 @@ export struct WebView {
367367 } catch (error) {
368368 Logger.error(TAG, `[RNOH]Errorcode: ${error.code}, Message: ${error.message}`);
369369 }
370- if (this.webNodeId) {
371- getNWeb(this.webNodeId)?.release()
372- }
370+ // if (this.webNodeId) {
371+ // getNWeb(this.webNodeId)?.release()
372+ // }
373373 }
374374
375375 transCacheMode(cacheMode: number): CacheMode {
You can’t perform that action at this time.
0 commit comments