UPDATE: Make stack close itself
bobsneidar at iotecdigital.com
Fri May 23 19:18:21 EDT 2014
I already know there is a problem closing a stack which a running handler belonging to that stack (I have destroyStack on because I want to remove the module from memory when I am not using it). This has actually been discussed a while back. Someone else was having the same issue. It seems if it’s the last command executed, it works, but if there is any script that runs after that, such as an on closeStack or on closeStackRequest (which I have) then (obviously) the command cannot complete. It would have to prematurely terminate running scripts. I’m pretty sure that is the issue.
The Idle option seems to work fine. In fact it’s the only option that works at all in this scenario!
Thanks for the reply though.
On May 21, 2014, at 11:48 , Robert Brenstein <rjb at robelko.com<mailto:rjb at robelko.com>> wrote:
On 21.05.2014 at 18:31 Uhr +0000 Bob Sneidar apparently wrote:
Okay well that is making a little more sense. So if I put an on idle handler in all my stacks and then pass the message, it should filter down to my mainstack. I suppose I could insert the stack-closing-code in all my substacks, but that makes me feel dirty somehow. ;-)
Idle is not the way to go IMHO. Try the flight recorder to see what is really going on. From a design point of view, a strategy to handle opening and closing work stacks (substacks) from a script in the mainstack should work. However, the substacks must have the destroystack property set and do not have any messages in the pending queue among others. Have you checked frontscripts?
More information about the Use-livecode