From 54ea70d2d66043e466339f40faf8e69d054f3143 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 23 Jul 2015 22:10:59 -0400 Subject: [PATCH] dereference unused dom elements, controllers and components --- mithril.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mithril.js b/mithril.js index a2e9811a..09884098 100644 --- a/mithril.js +++ b/mithril.js @@ -778,6 +778,11 @@ var m = (function app(window, undefined) { endFirstComputation(); return controllers[index]; } + if (!component) { + roots.splice(index, 1) + controllers.splice(index, 1) + components.splice(index, 1) + } }; var redrawing = false, forcing = false; m.redraw = function(force) {