-
11 Jan 2013 3:03 AM #1
Ext.EventManager.removeFromSpecialCache() iterating past end of array error
Ext.EventManager.removeFromSpecialCache() iterating past end of array error
Tested version: Ext JS 3.4.0, 3.4.1, 3.4.1.1 (Update May 2013)
Browsers: All
When "specialElCache.splice(i, 1);" removes an item from the "specialElCache" array, array length is no longer "len" and causes "TypeError: specialElCache[i] is undefined" (Firefox) when iterating past the end of the array.Code://Ext 3.4.1.1, ext-all-debug.js, line 5357 removeFromSpecialCache: function(o) { var i = 0, len = specialElCache.length; for (; i < len; ++i) { if (specialElCache[i].el == o) { specialElCache.splice(i, 1); } } },
I am now using temporary fix:
Update May 2013: The previous fix solved the problem in IE9 (the only version of IE I've tested this time around) and caused another - some elements no longer get automatically destroyed and stayed visible. This is not a detailed problem description because I don't have the time to look into it. My solution is simply to bypass the function entirely if browser is IE. Works great so far. New fix is below:
Code:removeFromSpecialCache: function(o) { if(Ext.isIE){return} var i = 0, len = specialElCache.length; for (; i < len; ++i) { if (specialElCache[i].el == o) { specialElCache.splice(i, 1); len--; } } },
-
11 Jan 2013 7:43 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Thanks for the report! I have opened a bug in our bug tracker.
-
23 Apr 2013 6:54 AM #3
Any update on this bug? I'm getting it when I call destroy() on an Ext.Window component.
Padraig.
-
23 Apr 2013 7:05 AM #4
-
23 Apr 2013 8:52 AM #5
For me it happens when I've got 2 htmleditor components on the window and I call destroy() on the window. With only 1 htmleditor on the window, the error does not occur.
It happens on the 2nd call to
in the beforeDestroy() function of Ext.form.HtmlEditor()Code:Ext.EventManager.removeFromSpecialCache(doc);
Padraig.
You found a bug! We've classified it as
EXTJSIII-100
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote