# HG changeset patch # User Vladimir Shabanov # Date 1346331618 -14400 # Node ID 9913c81bdbef76cfd832e0b34398e2fbc6750e9c # Parent b8558b613abdfeeba8c305bed085dd77ce1cb0f1 Fixed memory leak in dynClass diff -r b8558b613abd -r 9913c81bdbef lib/js/urweb.js --- a/lib/js/urweb.js Wed Aug 22 08:46:32 2012 -0400 +++ b/lib/js/urweb.js Thu Aug 30 17:00:18 2012 +0400 @@ -1104,27 +1104,28 @@ x.closures = concat(cls.v, htmlCls); } - addNode(x); + html.appendChild(x); populate(x); } if (s_style) { + var htmlCls2 = s_class ? null : htmlCls; var x = document.createElement("script"); x.dead = false; x.signal = s_style; x.sources = null; - x.closures = htmlCls; + x.closures = htmlCls2; x.recreate = function(v) { - for (var ls = x.closures; ls != htmlCls; ls = ls.next) + for (var ls = x.closures; ls != htmlCls2; ls = ls.next) freeClosure(ls.data); var cls = {v : null}; html.style.cssText = flatten(cls, v); - x.closures = concat(cls.v, htmlCls); + x.closures = concat(cls.v, htmlCls2); } - addNode(x); + html.appendChild(x); populate(x); } }