[qooxdoo-bugs] [Bug 771] Changing of theme causes error in disposed TreeVirtual
Brought to you by:
ecker,
martinwittemann
From: <bug...@qo...> - 2008-01-25 10:32:49
|
http://bugzilla.qooxdoo.org/show_bug.cgi?id=3D771 ------- Comment #2 from no...@ya... 2008-01-25 11:32 ------- Hugh, thank you for your suggestion. It helped me to find origin of the problem. Using the slightly modified version of Hugh=E2=80=99s getNewObjects functio= n and FireBug I found that the problem originates in constructors of Table and TreeVirtual. There is the following line in constructor of Table (line #172= ): this.setDataRowRenderer(new qx.ui.table.rowrenderer.Default(this)); There is the following line in constructor of TreeVirtual (line #194) that follows Table=E2=80=99s constructor call (line #168): this.setDataRowRenderer(custom.dataRowRenderer); As a result there is a lost reference to qx.ui.table.rowrenderer.Default ea= ch time TreeVirtual is created. To avoid this situation I suppose it is necess= ary to slightly modify constructors: a) replace line #172 in constructor of Table by the following lines if (custom.dataRowRenderer) { this.setDataRowRenderer(custom.dataRowRenderer); } else { this.setDataRowRenderer(new qx.ui.table.rowrenderer.Default(this)); } b) delete line #194 from constructor of TreeVirtual. Best regards, Denis PS Here is modified version of Hugh=E2=80=99s getNewObjects function. getNewObjects : function() { var vData =3D {}; var vCounter =3D 0; var vObject; var vDb =3D qx.core.Object.getDb(); var mHashCode =3D {}; var ar; for (var i=3DvDb.length - 1; i>=3D0; i--) { vObject =3D vDb[i]; if (vObject && vObject.__disposed =3D=3D=3D false) { var sClassName =3D vObject.classname; if (vData[sClassName] =3D=3D null)=20 { vData[sClassName] =3D 1; }=20 else=20 { vData[sClassName]++; } ar =3D mHashCode[sClassName]; if (ar =3D=3D null) { ar =3D mHashCode[sClassName] =3D new Array(); } ar[ar.length] =3D vObject.toHashCode(); vCounter++; } } if (! this._m_dObjectList) { this._m_dObjectList =3D {}; } var dMore =3D {}; for (var sClassName in vData) { if (!(sClassName in this._m_dObjectList)) { this._m_dObjectList[sClassName] =3D 0; } if (this._m_dObjectList[sClassName] >=3D 0 && this._m_dObjectList[sClassName] < vData[sClassName]) { dMore[sClassName] =3D vData[sClassName] - this._m_dObjectList[sClassName]; } } this._m_dObjectList =3D vData; var vArrData =3D []; for (var vClassName in dMore) { vArrData.push({classname : vClassName, number : dMore[vClassName], aHashCode : mHashCode[vClassName] }); } vArrData.sort(function(a, b) { return b.number - a.number; }); var vMsg =3D "Summary: (" + vCounter + " Objects)\r\n\r\n"; for (var i=3D0; i<vArrData.length; i++)=20 { vMsg +=3D vArrData[i].number + ": " + vArrData[i].classname=20 + " (" + vArrData[i].aHashCode.join(", ") + ")\r\n"; } return vMsg; }, --=20 Configure bugmail: http://bugzilla.qooxdoo.org/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. |