REALLY close stack

Troy Rollins troy at rpsystems.net
Wed Jun 16 00:42:04 EDT 2004


On Jun 16, 2004, at 12:29 AM, J. Landman Gay wrote:

> Just for the record, I routinely close stacks that have their 
> destroystack set to true and have never had any problem with it. It 
> may be that the stack must be saved with that property first, before 
> it works reliably (which would be a bug.) I have my preferences set to 
> always create new stacks with the property set, and I have never seen 
> a problem.
>

I've no doubt this is the case for you, but in various circumstances, 
which may only arise from a certain coding style,  it is more than 
possible to code it "correctly", have all the properties set 
"correctly", double-check them, and then have it not work.

In my case, I have external stack files, created by cloning an 
"internal" substack (which has destroyStack set to TRUE), before 
saving, I set destroyStack to TRUE in the clone. Later, I open it as a 
mainstack, and use it as a resource in my program. When I'm done with 
it, I again set destroyStack to true, and close it. But it doesn't go 
away... it hides in a corner, till it can jump out and break my 
scripts.

> Note that you must be careful with "delete stack" and make sure you 
> are only deleting mainstacks, which removes them from memory. If you 
> use "delete stack" on a substack, the substack really will get 
> permanently deleted from the stackfile and it will be gone forever.

Yes. That is indeed the fear. I think we should have a new option 
called killStack, which closes and purges regardless of properties 
etc., but doesn't do any deleting of anything.
--
Troy
RPSystems, Ltd.
http://www.rpsystems.net



More information about the use-livecode mailing list