Buttons extension: Bug in destroy function
Buttons extension: Bug in destroy function
lordnocillo
Posts: 2Questions: 1Answers: 0
Hi,
I think that there are a for clause that crash in the buttons extension. This clause is in destroy function and is:
for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
this.remove( buttons[i].node );
}
It remove the button and increment the i variable. There are a moment that the i is more large than the length of buttons and the method crash.
In my opinion, a possible solution is:
for ( i=0 ; i<ien ; i++ ) {
this.remove(buttons[i].node);
ien = buttons.length;
}
Regards.
This discussion has been closed.
Answers
Sorry,
I had see that in the newest version this problem is solved. I don't know how to remove this post.
Thank you!
No problem - thanks for posting this! I'm going to tag and release the dev version of Buttons soon.
Allan