Thanks Jacque - wise words as always. The idea that the delete would work depending on whether the stack was newly created had not occurred to me, but seems like a good reason why my simplified tests didn’t show the problem. I will try again to create a simple demo, and hopefully I can file a bug report.
Graham > On 17 Oct 2016, at 06:06, J. Landman Gay <jac...@hyperactivesw.com> wrote: > > I don't have an answer for you, but the problem may be related to something I > noticed when LC 7 was released. I have automated scripts that create and/or > update a series of stacks. When changes are completed to each stack, the > script does this: > > save stack x > close stack x > delete stack x > > Prior to LC 7, the stacks would be removed from memory. In LC 7 and up, the > stack is closed and removed from RAM only if the stack was newly created > during that particular run. If the stack already existed on disk and was > opened and updated, it does what you describe -- it closes but remains in > RAM. (It remains listed in the App Browser, and "there is a stack x" returns > true.) The destroyStack property on all the stacks is always false, though > that shouldn't matter because an explicit command to delete the stack should > work regardless. > > Since it isn't a big deal for my client we've been ignoring it. But maybe > that will give you a lead on how to pinpoint the problem. I suspect a bug in > there somewhere. > > > On 10/16/16 10:47 AM, Graham Samuel wrote: >> Using LC8.1.1 rc2, I’ve got a mainstack which I want to remove >> entirely from my project before replacing it with a template stack of >> the same name. The script to do this is in a library originating from >> another mainstack. For the target stack I have set the ‘cantDelete’ >> to false, and the ‘destroyStack’ and ‘destroyWindow’ to true. If my >> script just says >> >> close stack “myStack” >> >> then the stack window closes, but I think the stack is still in RAM - >> at least an ‘exists’ test says so (it’s not clear from the dictionary >> if ‘exists’ is supposed to work on stacks), and indeed the template >> stack doesn’t replace the original. If I add another line >> >> delete stack “myStack” >> >> I get an error 370 (object: stack locked, or stack’s script is >> executing). But it’s not locked. I don’t even know how to lock a >> stack, unless it’s by setting its ‘cantDelete’ to true. There are no >> ‘closeStack’ handlers in the target stack. >> >> Attempts to turn this into a simple recipe have failed, but it’s a >> real problem. What I want to do (I know I’ve asked before) is to >> execute the same code as the IDE does for ‘close and remove from >> memory’. >> >> Any ideas welcome. >> >> Graham _______________________________________________ use-livecode >> mailing list use-livecode@lists.runrev.com Please visit this url to >> subscribe, unsubscribe and manage your subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode >> > > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.com > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode