Memory in Macromanager must be managed to avoid possible leaks and instability.
The following is the best practice when creating macros.
Use local as opposed to global variables
Global variables are not cleaned up by LUA’s automatic memory management.
Use the local scope where possible. For example, to declare a variable ‘Test’ to nil locally use; local Test = nil
Variables that are created without a scope are global.
When global Variables are used, set them to nil at the end of the script
Global variables that are set to nil are cleaned by LUA automatically after the script runs.
Run automatic clean up at the end of a script
The Properties of each macro contain a setting to automatically purge the memory of the macro:
When enabled, Purging Memory will automatically destroy all variables created in that script.
Note: Purging Memory may prove too computationally heavy on scripts that run at a high frequency. (many times per second). |
Post your comment on this topic.