I'll do that mutex thing, I am already using it sometimesDrBullwinkle wrote:There may (or may not) be code that should be fixed, but there is an easy way to kill AL pileups forever: Use a mutex lock to prevent the loop from running if it is already running.

There is only one thing: There is no while loop or whatever being able to cause a hang of this script. Only possibility is an issue caused by another script it calls.
The only thing I have found is plugin.xrm.bountycleanup, which, under certain circumstances, will have *millions* of loop cycles inside, each loop with a wait time of 100-200 ms. If that occurs, then, to my thinking, it will be very likely to cause a hang.
Though it puzzles me, that I do not see it in the global script list.
So, I thought it would be better to optimize things. But for that I need to know what the purpouse of plugin.xrm.bountycleanup is.
Hey doc, if you like, just have a look at that script and tell me your opinion.