Looking for tips on memory mgt in standalones

Monte Goulding monte at sweattechnologies.com
Thu Dec 6 20:02:56 EST 2012


On 07/12/2012, at 11:46 AM, Peter Haworth wrote:

>> So If I duplicate a stack for a "document", and I tell it 'close this
>> stack'. It doesn't actually remove the stack that was closed from
>> memory? Whoa, I'm in for some refactoring if that's the case.

Like Robert said you need to set the destroyStack. Actually the design you have above isn't brilliant for maintenance. Stacks are great containers for structured data (particularly if it's not a heap of data in which case I'd use a sqlite db file) but it's much better design to have an invisible stack file with no controls and all the data in custom properties and then a template document viewer that you clone if your app can have multiple documents open. Otherwise version 2 of your app comes out and you need to write routines to move data from version 1 of your document file to version 2. Got caught by that one on a couple of my first LC apps...

Cheers

Monte

--
M E R Goulding 
Software development services
Bespoke application development for vertical markets

mergExt - There's an external for that!




More information about the use-livecode mailing list