Why are modal loops bad?

The central reason is that if you're running a modal loop, there's a whole stack full of code underneath you. Anything can happen during the modal loop, including the deletion of objects which are relied upon when that stack gets unwound later. It's particularly bad in plugins, where the host could delete your plugin before it has had a chance to unwind its stack, which is an unrecoverable situation.

1 Like