From 2fe869e4f000888e596fde3ed8dc570cbdcdf3bb Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Thu, 23 Jul 2015 22:33:15 -0400 Subject: [PATCH] fix memory release check --- mithril.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index 292f9333..98480fe0 100644 --- a/mithril.js +++ b/mithril.js @@ -606,7 +606,8 @@ var m = (function app(window, undefined) { if (cached[i]) unload(cached[i]); } } - nodes.length = 0; + //release memory if nodes is an array. This check should fail if nodes is a NodeList (see loop above) + if (nodes.length) nodes.length = 0; } function unload(cached) { if (cached.configContext && isFunction(cached.configContext.onunload)) {