My standalone (OSX10.12.6 LC 8.1.9) on the the file menu has a command to quit :
Code: Select all
...
case "Esci"
case "Exit"
case "Quit"
case "Quit Tcal"
doFileQuit
break
end switch
end menuPick
Code: Select all
on doFileQuit
set the defaultstack to "Tcal" --main stack
lock messages
--close all sockets
if the openSockets <> empty then
repeat for each line tSock in the opensockets
close socket tSock
end repeat
end if
--close the stacks in this application:
put the stacksInUse into myStacks
repeat for each line myStack in myStacks
stop using stack myStack
end repeat
-- stacks
put the openStacks into myStacks
put "Tcal,message box,home,tool,Message Box,revTools,revMenubar" & comma & the short name of me into myDontClose
repeat for each line myStack in myStacks
if myStack is not among the items of myDontClose then close stack myStack
end repeat
-- messages
put the pendingmessages into myMsgs
repeat for each line myMsg in myMsgs
cancel item 1 of myMsg
end repeat
close me --not sure about this but deleting it doesn't make a difference
if the environment is not "development" then
quit
end if
end doFileQuit
The second time I run the standalone, it quits fine.
I tried also to put a "Quit" directly on the menuPick (bypassing the doFileQuit). Also saving to a text file reports on different parts of the doFileQuit script (everything runs fine).
And there is no shutdownRequest anywhere on the stacks.
I don't know what else to try, in order to trace what's happening, since I cannot really trace the "quit" on development.
Any Idea?
Trevix