Buttons extension: Bug in destroy function

Buttons extension: Bug in destroy function

lordnocillolordnocillo Posts: 2Questions: 1Answers: 0
edited May 2018 in Free community support

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.

Answers

  • lordnocillolordnocillo Posts: 2Questions: 1Answers: 0
    edited May 2018

    Sorry,

    I had see that in the newest version this problem is solved. I don't know how to remove this post.

    Thank you!

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    No problem - thanks for posting this! I'm going to tag and release the dev version of Buttons soon.

    Allan

This discussion has been closed.