From 27781d44ac2eb44a88c2f0d2f0dde10a822b79d0 Mon Sep 17 00:00:00 2001 From: Yuval Greenfield Date: Mon, 31 Dec 2012 23:46:53 +0200 Subject: [PATCH] Fixed memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original technique isn't horrible when it happens once per mouse move but if used once per frame it completely destroys the browser. To see the leak in the chrome task manager - furiously move the mouseĀ and see the top cpu process keep rising in memory usage. --- examples/Scripts/Chain.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Scripts/Chain.html b/examples/Scripts/Chain.html index 30b5f38f..eb1d8b1e 100644 --- a/examples/Scripts/Chain.html +++ b/examples/Scripts/Chain.html @@ -26,8 +26,8 @@ for (var i = 0; i < size - 1; i++) { var nextSegment = segments[i + 1]; var position = path.segments[i].point; - var angle = (position - nextSegment.point).angle; - var vector = new Point({ angle: angle, length: 35 }); + var vector = position - nextSegment.point; + vector.length = 35; nextSegment.point = position - vector; } path.smooth(); @@ -47,4 +47,4 @@ - \ No newline at end of file +