diff --git a/js/common/bootstrap/modules.js b/js/common/bootstrap/modules.js index 7dea7b9090..7886e46f86 100644 --- a/js/common/bootstrap/modules.js +++ b/js/common/bootstrap/modules.js @@ -394,13 +394,20 @@ function stop_color_print () { //////////////////////////////////////////////////////////////////////////////// Module.prototype.unloadAll = function () { + var i; var path; + var unload = []; for (path in ModuleCache) { if (ModuleCache.hasOwnProperty(path)) { - this.unload(path); + unload.push(path); + ModuleCache[path]._normalized = {}; } } + + for (i = 0; i < unload.length; ++i) { + this.unload(unload[i]); + } }; ////////////////////////////////////////////////////////////////////////////////