Delete a stack from memory - fails?

Trevor DeVore lists at mangomultimedia.com
Tue Jul 29 09:12:27 EDT 2008


On Jul 29, 2008, at 6:46 AM, David Bovill wrote:

> closes and removes a stack from memory (for a mainstack not substack)
> regardless of the destroystack/window status or whether the stack is  
> used as
> a library. The issue is that it does not always work - and I could  
> not track
> down why. Thought I would post my findings... there are two reasons  
> i know
> of when using "delete stack" does not work:
>
>   1. you are using and external (not quiet sure exactly the issues  
> here)
>   2. a script is being edited (not sure if this is just Galaxy but  
> suspect
>   it is any editor but do not understand why as its just text in a  
> field?)
>
> I need as full proof a way as possible way to close a stack. To do  
> that it
> si important to understand in detail why editing a script or using and
> external from within a stack might prevent deleting the stack from  
> memory.

Hi David,

I'm not sure that the problem is with 'delete stack'. I have found  
that this is always reliable but that other things can be going on  
which immediately bring the stack back into memory.

Every time the engine checks for the existence of a stack, accesses a  
property or issues the go command using the filename of a stack the  
stack is loaded into memory. In your Galaxy example what is most  
likely happening is that the script editor has a tab open for a  
control or object in the stack you deleted. It then references that  
stack on disk and loads it back into memory.

As for the external, if you can find a repeatable case that shows that  
delete stack doesn't work when an external is loaded that would be  
great. I haven't tested this scenario much myself as I always call any  
cleanup routines in the external (if necessary), stop using the stack  
as a library and then delete. This has proven reliable in all of my  
tests.

Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com



More information about the use-livecode mailing list