From 71cf768459190939c93de90ee9633f30a765bb6a Mon Sep 17 00:00:00 2001 From: Sir-Ripley <31619989+Sir-Ripley@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:35:53 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20[Performance]=20Fix=20Canvas=20Anim?= =?UTF-8?q?ation=20Memory=20Leak=20in=20BiologyView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- components/BiologyView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/BiologyView.tsx b/components/BiologyView.tsx index 9c5d4ca..046a65c 100644 --- a/components/BiologyView.tsx +++ b/components/BiologyView.tsx @@ -58,9 +58,9 @@ const BiologyView: React.FC = () => { else ctx.lineTo(x,y); } ctx.stroke(); - requestAnimationFrame(anim); + id = requestAnimationFrame(anim); }; - const id = requestAnimationFrame(anim); + let id = requestAnimationFrame(anim); return () => cancelAnimationFrame(id); }, [result]);