comparison lib/js/urweb.js @ 1811:9913c81bdbef

Fixed memory leak in dynClass
author Vladimir Shabanov <vshabanoff@gmail.com>
date Thu, 30 Aug 2012 17:00:18 +0400
parents d2383ffc18ab
children ea5f920ffa35
comparison
equal deleted inserted replaced
1810:b8558b613abd 1811:9913c81bdbef
1102 var cls = {v : null}; 1102 var cls = {v : null};
1103 html.className = flatten(cls, v); 1103 html.className = flatten(cls, v);
1104 x.closures = concat(cls.v, htmlCls); 1104 x.closures = concat(cls.v, htmlCls);
1105 } 1105 }
1106 1106
1107 addNode(x); 1107 html.appendChild(x);
1108 populate(x); 1108 populate(x);
1109 } 1109 }
1110 1110
1111 if (s_style) { 1111 if (s_style) {
1112 var htmlCls2 = s_class ? null : htmlCls;
1112 var x = document.createElement("script"); 1113 var x = document.createElement("script");
1113 x.dead = false; 1114 x.dead = false;
1114 x.signal = s_style; 1115 x.signal = s_style;
1115 x.sources = null; 1116 x.sources = null;
1116 x.closures = htmlCls; 1117 x.closures = htmlCls2;
1117 1118
1118 x.recreate = function(v) { 1119 x.recreate = function(v) {
1119 for (var ls = x.closures; ls != htmlCls; ls = ls.next) 1120 for (var ls = x.closures; ls != htmlCls2; ls = ls.next)
1120 freeClosure(ls.data); 1121 freeClosure(ls.data);
1121 1122
1122 var cls = {v : null}; 1123 var cls = {v : null};
1123 html.style.cssText = flatten(cls, v); 1124 html.style.cssText = flatten(cls, v);
1124 x.closures = concat(cls.v, htmlCls); 1125 x.closures = concat(cls.v, htmlCls2);
1125 } 1126 }
1126 1127
1127 addNode(x); 1128 html.appendChild(x);
1128 populate(x); 1129 populate(x);
1129 } 1130 }
1130 } 1131 }
1131 1132
1132 function addOnChange(x, f) { 1133 function addOnChange(x, f) {