From 12992e35210b6f68b573cf5e880c8cba29f85341 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Tue, 17 Sep 2019 22:40:59 -0700 Subject: [PATCH] Prevent memory leak when component updates and ref changes --- resources/scripts/components/server/Console.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/scripts/components/server/Console.tsx b/resources/scripts/components/server/Console.tsx index a20700792..ddbf73fe9 100644 --- a/resources/scripts/components/server/Console.tsx +++ b/resources/scripts/components/server/Console.tsx @@ -45,7 +45,7 @@ export default () => { ); useEffect(() => { - if (ref.current) { + if (ref.current && !terminal.element) { terminal.open(ref.current); // @see https://github.com/xtermjs/xterm.js/issues/2265