Attached is an HTML file that illustrates a problem I've had with DynAPI3. The page contains two buttons and creates a DynLayer in its "init" method. When the "Add layers" button is pressed, three new DynLayers are added to the top level layer - no problem. When the "Remove layers" button is pressed, the deleteAllChildren method is called on the top DynLayer, but only the first two child layers disappear - the third one stays put. This problem occurs on IE5, IE6 and Mozilla1.3.
While looking at the "deleteAllChidren" function in src/api/event.js, I found that I could fix the problem (sort of) by changing direction of the "for" loop on line 164 from:
for(var i=0;i<l;i++){
to
for(var i=l-1;i>=0;i--){
however I don't understand why this change would make any difference. And it leaks memory with or without my change, so I expect that it isn't a proper fix in any case.
So, is this a bug or am I simply doing something wrong?
regards, Andrew Gillett