From 42721252f31a1ed8b731bb5392e0ad216c3dc6b1 Mon Sep 17 00:00:00 2001 From: Hudo Assenco Date: Sun, 29 Mar 2020 08:14:55 -0300 Subject: [PATCH] fix: memory leak with updateVariantTimeout --- src/Experiment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Experiment.js b/src/Experiment.js index d2009dd7..08124491 100644 --- a/src/Experiment.js +++ b/src/Experiment.js @@ -80,6 +80,7 @@ class Experiment extends React.Component { } componentWillUnmount() { + clearTimeout(this.updateVariantTimeout); typeof window !== "undefined" && window.gtag && window.gtag("event", "optimize.callback", {