summaryrefslogtreecommitdiff
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Vladimir Shabanov <vshabanoff@gmail.com>2012-08-30 17:00:18 +0400
committerGravatar Vladimir Shabanov <vshabanoff@gmail.com>2012-08-30 17:00:18 +0400
commite73d61c2df8c3c53bdb30dcfba996fea2e081acc (patch)
treeeceb2682f72912db9895f111897252e214da6f3b /lib/js
parent067c8d9d0e11ee60eed428a9f8472c2e1e6edff0 (diff)
Fixed memory leak in dynClass
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index a181bbf9..4645df51 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1104,27 +1104,28 @@ function dynClass(html, s_class, s_style) {
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);
}
}