Page 1 of 1

Stacks and windows don't purge on close?

Posted: Sun Nov 12, 2006 9:12 pm
by nkrontir
Hi.

It seems that my processes never die when the executable has been built by Revolution, but hang even after the stacks close (this does not happen to a specific application, but to everything I have attempted to build as a standalone). I always check both "purge stack on close" as well as "purge window on close" on all stacks and check the "Set destroyStack property to true" in "Standalone Application Settings".

Setup: Windows Me, Revolution Studio 2.7
Any ideas?

Posted: Mon Nov 13, 2006 10:31 am
by oliverk
Hi Nkrontir,

When you build a standalone application, your stack is bound to the Revolution engine and the two are saved together.

If you close the stack, regardless of whether the destroyStack property is set to true, the Revolution engine will still be running, just the stack will have been removed from memory.

If you are building a standalone application it is normal to use "quit" rather than "close" to exit the application. This command will close the entire application and leave nothing in the Windows process list.

It may be a good idea to write your own handler to wrap around this, so that you don't accidently quit Revolution when you are working on the stack. For example:

Code: Select all

on applicationQuit
  if kDevelopmentMode then
    close this stack
  else
    quit 0
  end if
end applicationQuit
Hope this is some help.

Regards

Oliver

Posted: Mon Nov 13, 2006 11:14 am
by malte
Another thing you might wish to make sure is if there are any messages left in the pendingmessages. If you run a timed script

send myHandler to me in 40 milliseconds

the engine can not quit.

A common trick is to lock messages before trying to quit

lock messages
quit

Hope this helps,

Malte

Posted: Mon Nov 13, 2006 6:01 pm
by nkrontir
Hi guys.

I appreciate your help. This is what I did:

Code: Select all

on closeStack
  if the environment is "development" then
    close this stack
  else
    lock messages
    quit
  end if
end closeStack
which worked like a charm.

Thanks.

P.S: Do you think we should move it out of the "Windows" category, since I see now that it's not a windows-specific issue?