New Stack crash
janschenkel at yahoo.com
Wed Jun 23 03:43:08 CDT 2010
You're probably running out of memory - delete stack may not release everything right away.
My first step would be setting the templateStack properties 'destroyStack' and 'destroyWindow' to true - that way the resources claimed by the stack and its window are released upon close. By default these are false.
The second step would be to give the engine's memory manager / garbage collector a chance to get rid of the obsolete allocated memory. You could try inserting 'wait 0 milliseconds' after the delete; or convert your loop to a 'send in time' construct with a short delay.
Quartam Reports & PDF Library for Revolution
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
--- On Tue, 6/22/10, Dan Friedman <dan at clearvisiontech.com> wrote:
> I have the following script in a button:
> on mouseUp
> put 0 into i
> repeat 30000
> add 1 to i
> put ("testStack_" & i) into sName
> new stack sName
> delete stack sName
> end repeat
> end mouseUp
> Two questions:
> (1) Why would this start to slow down? It starts off
> quite fast, then it beings to slow down. It gets so
> that it takes 5, or 6 seconds to complete one repeat.
> This happens in both in REV and as a standalone. Is
> this because of the "add 1 to i"? Is this no better
> than "repeat with i = ...", which is known to be slow?
> (2) Rev will eventually crash. In my testing, it
> seems random and crashes sometime after about 1700.
> Shouldn't the "delete stack" call completely remove the
> stack? So, why crash?
> Any thoughts?
More information about the use-livecode