Removing a stack from memory...

Paul Dupuis paul at researchware.com
Mon May 14 15:19:00 EDT 2018


I know this has been discussed before, so my apologies that my Google-Fu
has failed to find any prior answer.

I have a complex script - part of an Installer "maker" written in
LiveCode - that creates stacks and builds them into Standalones for
various platforms via a long automated script. After the script has
assembled all of the necessary stacks for a build, it executes:

*send*"revSaveAsStandalone"&&quote&tStackName&quotetostack"revSaveAsStandalone"

To perform the build. All is good up to this point. The script then
executes "close stack tStackname" and reaches the 'end repeat' to start
the next loop for the next build. The problem is that the next build
contains some stacks with the same names as from the previous build and
I get warning messages about having multiple stacks in memory with the
same name.

I have verified that destroyStack is true. I have added a "wait 5 sec
with messages" after the "close stack tStackname". tStackname is no
longer listed in "the openStacks" nor in "the stacks". It is however
still in memory and listed in "revLoadedStacks(application)". I even
tried the following script calling "removeStackFromMemory tStackName".
*command*removeStackFromMemory pStackName
   *set*wholeMatchestotrue
   *repeat* whilepStackName isamongthelinesofrevLoadedStacks(application)
      *set*cursortobusy
      *set*thedestroyStackofstackpStackname totrue
      *close*stackpStackName
     *wait*1secondwithmessages
   *end* *repeat*
*end*removeStackFromMemory

To try to ensure that tStackName was removed from memory. No luck. While
the script is executing (even though this script is not part of
tStackName) the file will not be removed form memory.

Does anyone know of a hidden "revXYZ" command (a counterpart to
revLoadedStacks) or some way of absolutely reliably removing a stack and
its substacks from memory when you ask it to!!!!!







More information about the Use-livecode mailing list