From 29d2ec0416fb5ccad24f54ea05a07508bbf1a042 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 28 Jul 2021 21:44:52 +0300 Subject: [PATCH] Teact: Fix DOM nodes leak --- src/lib/teact/teact.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/teact/teact.ts b/src/lib/teact/teact.ts index c93fe9334..c98b02a41 100644 --- a/src/lib/teact/teact.ts +++ b/src/lib/teact/teact.ts @@ -377,7 +377,7 @@ function unmountComponent(componentInstance: ComponentInstance) { helpGc(componentInstance); } -// We force cleaning as many objects as possible. Not sure this is needed at all. +// We need to remove all references to DOM objects. We also clean all other references, just in case. function helpGc(componentInstance: ComponentInstance) { /* eslint-disable no-null/no-null */ @@ -399,6 +399,7 @@ function helpGc(componentInstance: ComponentInstance) { componentInstance.hooks = null as any; componentInstance.$element = null as any; + componentInstance.renderedValue = null as any; componentInstance.Component = null as any; componentInstance.props = null as any; componentInstance.forceUpdate = null as any;