Not really a recursive problem...
-
I got a situation where components are updating others, and all of them call a function.
What security should I implement in order not to call the function several times?In the snippet, you'll see that the knob normally calls the function.
But the button updates the knob, thus the function is called twice...
How can I prevent this cleanly? another function that checks from where the call is coming? a simple flag?HiseSnippet 1018.3ocsV0saaaCElxIrqVstnsnO.B4JEfNC4s1tALTjr37CL5RpwTR2tqiQhJlvTjphTcwMH2smm9JrdcuaOB6MXuAaGRIaojnllZfIeiO+7c3GIO+vw4xHpRIyQNcObVFE4bWb3LgdxvIDl.MZajy8v6STZZtWopslkQTJZLxwYk8LJb5tJx98OarEgSDQzZUHzqjrH5OwRY5Zsi27ELNeWRL8PVZCuexlihjhgRtr.3yJ3.TFIZJ4D5ADiacvHmasSLSKyC0DMUgbVcKY7rvIxeWT5+qXJ1wbpQX.JDBTo5ck7XCiM+GMbBiGOd99VgfnLt9TXkxSgGg2mEyVnu9z39VCd0HZdd3z45n2fkjdNMn2pkz6A3vnbVlt1hga2AOR.WTID3JnIsJ8E04icvCkfGBc+TxT5t4fvBD9OKH3wdOMHX8enmK3lRxo8i3TRtuQSOW3pQo8dKI2aqBsVJF38bu4g6DpdnLMSJ.A+0prulAWMpWHjG+owXstV4JY9wDblf5kTHhzLovSJphpAdtj6GMG6ignyKnq2y8rdtdvGKwyuTUkByWVNSnCkoT8Dl3D6VZtI6R2OZBQbBMdgky64dN72pUsuxvV6JOjv4GC4k9WlRWG4sqwmm5svRCIJYXqTnYfqIvUovki7hkb9Us0A+0V3BbW3ddicvARM8kB+0cOysq64tdW1TRRq1pnFml2pYSCf7qCnunH8XZ97Sp4NBUBWrT6N2rRsnxjuFNJEiDL8KynUx0EiFak654VCPK1rMUUuGap0t0ZwsZUWsVGUUb.U8cpbGbUaq4uWUMeYRGhAbrKtJCDYOcZ12E8ofGxYwzbK7uBaydt.Xu2u2esA5nQaSzDSumJBAjLilqYliZmsouEZpW1IpKdapZpVlYYbUdMxAeC37o078nMmsP3C+xlL09PZnPSxA0NcPMB7c+r6l5v9auoQXg0PomYxHtk0QTJKNlSGKULSFWiwX+ILsKKj8N6QxYO58682u6O1Hs4jNDJkbZyAephjD1o1QTILdpRCbaTJL4B47P7QJpWLMgTv0dpoPbfJyoz3CkV+QWs6NLiQFWvI5KN3wLssxfgvM6va5hKfMxrlj5KXZTPqSiFzVF5MjtO.OloilzNe6zBeMo7+Oy2pY68v6jjPiz0jcU7t+5xNH+KfJ+rrPCcV2m.oGPxB9fhzP3oNQTfIBAkCKDFx1MPsxAFYyISHUDaE9W3qx3.irSkwAyMBIlQ4xWGUV7ad8vssZ.NIrOhpK7ZNP1aQUOFGzOvTLvdcTj4n3qGfPsi4aVBLe6Rf4IKAlmtDXd1Rf46VBLe+0hw7dxerPKSKKS.Ei2w180wYGAAxxrYjn+C9b2KbC
-
In that minimal example I would say use a flag. But in a real world example I might give a different answer :p
-
@d-healey Ahaha! Which answer?? which one??!
My project is quite heavy on the interface script, with complex panels and functions interaction with big loops in each, timers... So I need to be careful with what I'm calling and when I'm calling it...
At the moment, a function can be called 8 times, which is bad bad bad... -
@ustk Yeah that sounds bad :p I'd try to remove as many
.changed()
calls as possible. -
@d-healey Hum... That does seem possible as I still need to update those components...
I'll try with a general flag to see if it's not too dirty (well, it can't be worse anyway... )