destroyStack

Typeproperty
DictionaryLCS
LibraryLiveCode Script
Syntax
set the destroyStack of <stack> to {true | false}
Associationsstack
Summary

Specifies whether a stack is purged from memory when it's closed, or whether it remains in memory.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
set the destroyStack of this stack to true
Values
NameTypeDescription
Value

The destroyStack of a stack is true or false. By default, the destroyStack property of newly created stacks is set to false.

RelatedProperty: destroyStack
Message: reloadStack
Command: close
Function: heapSpace, stacks, hasMemory
Glossary: property, handler, stack file, application, stack window, execute
Object: stack
Description

Use the destroyStack property to leave a stack in memory after it is closed.

If a stack's destroyStack property is set to true, closing all stacks in its stack file removes it from memory space, cleaning up after the stack and freeing memory for use by the application. If any handlers in the stack are running, the stack is not purged from memory until all handlers have completed. (The stack is not removed from memory until all stacks in the same stack file are also closed.)

If the destroyStack is false, closing a stack's window leaves it in memory. If you open and close many stacks in a session, and the destroyStack of all these stacks is false, the memory used by these stacks will continue growing until you quit the application. If you reopen the stack during the same session, a warning message appears cautioning you that the stack is already open.

If you close a stack whose destroyStack is true while a handler is running, the stack is removed from memory after all running handlers finish executing. This means that if you close and re-open a stack during a handler, and the stack's destroyStack is true, the stack is removed from memory (and closed again) after the handler finishes.

Note: Despite its alarming name, the destroyStack property does not destroy or damage a stack. It simply allows it to be automatically removed from memory.

Tagswindowing