PDA

View Full Version : [4.0.2a] Race condition in `doAdd/doRemove` of Ext.tree.View



SamuraiJack1
20 Jun 2011, 5:22 AM
Both `doAdd/doRemove` of Ext.tree.View contains race conditions:


if (!animWrap || !animWrap.expanding) {
me.resetScrollers();
return me.callParent(arguments);
}
If `me.resetScrollers()` will trigger a layout, then the view will be already refreshed and `me.callParent(arguments);` will cause either extra row removal or extra row addition.

Should be


if (!animWrap || !animWrap.expanding) {
var res = me.callParent(arguments);
me.resetScrollers();
return res
}
instead. Here we call the parent method first, and only then doing "resetScrollers" (potentially with full refresh).