diff --git a/CustomDialogPractice/entry/src/main/ets/pages/GlobalDialogDecoupledFromThePage.ets b/CustomDialogPractice/entry/src/main/ets/pages/GlobalDialogDecoupledFromThePage.ets index 7736b1b52722e3e0e54087074e2202f052eb41d4..a1d2190cf714b006f8dd591186371b6ff1835dad 100644 --- a/CustomDialogPractice/entry/src/main/ets/pages/GlobalDialogDecoupledFromThePage.ets +++ b/CustomDialogPractice/entry/src/main/ets/pages/GlobalDialogDecoupledFromThePage.ets @@ -77,6 +77,12 @@ export struct GlobalDialogDecoupledFromThePage { PromptActionClass.setOptions({ alignment: DialogAlignment.Center, maskColor: 'rgba(0, 0, 0, 0.2)' }); } + aboutToDisappear(): void { + if (PromptActionClass.contentNode !== null) { + PromptActionClass.contentNode.dispose(); // release contentNode. + } + } + build() { NavDestination() { Column() {