memory, buffered images and closed stacks (and groups?)

Nicolas Cueto niconiko at gmail.com
Fri Jul 29 01:27:40 EDT 2011


Hello.

Actually, this is about a crash caused by the command "group". Which I
explain further down. But first...

How can I make sure that a closed stack releases all memory, i.e.,
that the stack is "really" closed?

I'm prompted to ask cause of some odd memory results I'm encountering.
More or less, here's the memory usage as shown by Windows' Task
Manager:

1) Standalone and a central stack open = 38,000 K
2) Click a button on central stack so it hides itself and then opens a
game stack  = 40,000 K
3) Game stack does "stuff" to itself (cf. below) = 43,000 K
4) Close game stack and unhide central stack (standalone of course
still open) = 45,000 K

[Note that at (4), I confirm with "put the openstacks" that the
standalone and the central stack are indeed the only open stacks.]

The memory state at (4) seems significantly greater than at (1), is it
not? Or is this normal for LC?

About the "stuff" my game stack does to itself (!). When it opens, it
clones up to 36 group objects, each bearing buffered images. Plus
there's over 300 other buffered images, each of whose size property
ranges at about 2000. Also, the stack resizes itself as the game goes
along.



Finally, about that "group" crash. Which is what's really prompting me
to write this.

Everything's ok the first time that game stack of mine runs. But, when
I close it, return to the central stack, and then go back to the same
game stack, kaboom!

Took uninterrupted hours of trial-and-error till I isolated the
problematic script line in the game stack. Here's the naughty bit:

repeat for each item tTile in tGroupingData
     if there is not a group tTile then
        put "WTF!" into tMsg
        answer tMsg
        exit to top
     end if
     set the selected of group tTile to true
end repeat
group
select empty

The line "group" is when the crash happens, after "end repeat" and
never getting to "select empty" (nor ever seeing a "WTF!").

I've already tried adding a "select empty" before the "repeat for",
and a "wait xxx milliseconds with messages" after the line "group".

So, now I'm trying the list :-)

Thanks.

--
Nicolas Cueto




More information about the use-livecode mailing list