DestroyStack problem...

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MartinB2
Posts: 6
Joined: Sat Apr 23, 2011 9:33 am

DestroyStack problem...

Post by MartinB2 » Tue Apr 26, 2011 1:45 pm

Hi,
I have been struggling with the following problem...

I have written two apps. One I want to be a Terminate Stay Resident app, and the other to be unloaded from memory when the user closes it. I have set the DestroyStack value to be "False" for the TSR and to "True" for the app that I want to be removed from memory... however the opposite behaviours are experienced. i.e the app I want to remain in memory purges, and the app that I want to unload remains as a process visible using the Windows Task Manager.

Well actually I have now moved beyond my original situation as I am now running the TSR as a service, but using a version of it for configuration, and now when I want the app to be purged from memory..... You guessed it, it now refuses to unload. And yes, I have changed the set the destroystack value to true. I have made sure that there are no pending messages (ie have been queued with the "send" command)

Just as a test, I created a simple new stack with two buttons. One that set the destroystack value to "True" and closed the stack and the other button set the destroystack value to "False" and closed the stack. When a standalone was created, both buttons had the same effect. They both closed and purged the app from memory.

I am really confused as to why this is not behaving, but guess I have missed something really basic.

Any help or clarification would be much appreciated.

Cheers - Martin

I am using LiveCode V4.5.3 on Windows, creating Standalones for Windows

MartinB2
Posts: 6
Joined: Sat Apr 23, 2011 9:33 am

Re: DestroyStack problem...

Post by MartinB2 » Tue Apr 26, 2011 2:14 pm

Wouldn't you believe it. I think I have sorted it, well I have managed to remove from memory the stack that I didnt want left there.

I believe (and I will test to make sure) that the problem was down to me using "set the destroystack of this stack" rather than set the destroystack of the defaultstack".

However, I will have to go back to the simple test stack I created over the weekend to see if I had made the mistake in that as well.

Cheers - Maritn

Post Reply