I have an app in which users create documents (stacks) that auto-save when 
they're closed. I have a a few customers who are getting corrupted stacks every 
once in a while. At least in a couple of cases they are saving to a network 
server or over an internet connection. In some cases it seems to occur when 
they quit with a stack open. I've attempted to script around this by checking 
for the tilde version of the file and if it exists to  pause quitting.

I would say the stack size varies between 1 to 5 mb in size. App build with LC 
9.5.1 and a mix of Mac and Windows standalones.

Does anyone have any input with my shutdown routine? Ways of making it more 
robust?

Local sMyTildeFilename
on shutDownRequest
   Global gOpenDocument,gLastDocumentOpen
   --gOpenDocument contains the name of a currently open stack (if any)
   --gLastDocumentOpen contains the fileName of the last open stack
   --in case it was closed before quitting
   
   if gOpenDocument is among the lines of the openStacks then
      put the fileName of stack gOpenDocument & "~" into sMyTildeFilename
      save stack gOpenDocument
      close stack gOpenDocument
   else put gLastDocumentOpen & "~" into sMyTildeFilename
      
   --Don't allow quit until the temp file is deleted:
   if there is a file sMyTildeFilename then
      send quit to me in 1 second
   else pass shutDownRequest --Lets it quit
end shutDownRequest


Marty
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to