Hi,
This is the quilty one

When Select is called the while function will be re-entered, again and again until the stack flows over
You have to set a busy flag on entering the function an first check if it is true, if true then exit. When the function exit you set the flag again to false.
Do not put the flag on the stack.
something like this will do:
Code:
if (!select_change_busy) {
select_change_busy = true;
// here the code
select_change_busy = false;
}
In the article it was with the mousebutton I think. But it is similar.