crash when going between stacks

Nicolas Cueto niconiko at gmail.com
Tue Jun 22 19:37:34 EDT 2010


Dear List,

One of my more complex Rev creations is crashing.

To outline the complex, there are:

- a standalone
- a central stack for game-stack selection
- a myriad of game-stacks, some of them having substacks

Crashes happen when a game-stack closes to return to the central
game-selection stack. For one game-stack in particular (call it
BAD-GAMESTACK), crashes happen almost always, and for the other
game-stacks, only occasionally.

I double checked that every stack, substack, and card has a
preopen/open/close handler, even if this is empty.

I think it may be a memory issue, cause the game-stack that almost
always crashes has 100 URL-referenced image objects and runs on older
Win machines. BUT, I'm no longer sure since crashes with this
particular game-stack happen occasionally too on my uptodate,
memory-laden development computer.


Below is an outline of the scripted inter-relation between stacks. If
patient members would have a look and figure out what's wrong, I'd be
very grateful -- and happy to resolve a problem that's been bugging me
for months.

Thank you.

--

Nicolas Cueto

------  S T A R T    O F     S C R I P T S   -----


/*  In the card script of STANDALONE stack,
   this handler sets stackFiles and then goes to
  stack CENTRALSTACK. */

on setUpTheFoundation
    start using stack "STANDALONE "
    put "GAMESTACK1,gamestack1.rev" & cr & "GAMESTACK2,gamestack2.rev"
& cr & ... \
        & "animationEngine,animationEngine.rev"       into      tStackFiles
    set the stackFiles of stack "niconiko" to tStackFiles
    ## Set the globals used by all stacks
    open stack "CENTRAL"
    hide stack "STANDALONE"
end setUpTheFoundation





/* In stack script of CENTRALSTACK. */

on closestack
   quit
end closestack






/* In a go-to-gamestack button script on
   CENTRALSTACK./

on mouseUp
   open stack GAMESTACK
   hide stack CENTRALSTACK
end mouseUp






/* In the stack script of  BAD-GAMESTACK */

on closeStack
   ## Reset custom props of some grouped objects.
   ## Clear pending messages
   ## Clear the cachedURLs.
   set the lockScreen to true
   ## Set to empty the filename of 100 images.
   set the lockScreen to false
   go to card "main" of stack "gss"
   show stack "gss"
   delete stack "blitz"
end closeStack





/* In the card script of  BAD-GAMESTACK, which script
   calls up the NAVIGATION-SUBSTACK that can take
   user back to CENTRALSTACK.  */

on rawKeyUp theKey
   switch theKey
      case "56"
         modal stack NAVIGATION-SUBSTACK
         pass rawKeyUp
         exit rawKeyUp
         exit to top
         break
    end switch
end rawKeyUp

on closecard
   ## Clear the cachedURLs.
   ## Cancel pending messages.
   ## Reset custom props.
   ## For each of 100 image objects:
   ##   reset filename to "", outerglow,
   ##   and innerglow.
   ## Close the socket connection to
   ## the local server.
end closecard






/* In the card script of  NAVIGATION-SUBSTACK. */

on rawKeyUp theKey
   put "49,50,51,52" into tGameControllerRightsideButtons
   if theKey is not among the items of tGameControllerRightsideButtons then
      pass rawKeyUp
      exit rawKeyUp
   end if
  ## Find which navigational image is on.
   switch tCurentlyOnImage
      case "quit"
         send "closeStack" to stack BAD-GAMESTACK in 2 seconds
         close this stack -- i.e., NAVIGATION-SUBSTACK... should I
name the stack explicitly here?
         exit to top
         break
   end switch
end rawKeyUp



------     E N D    O F     S C R I P T S   -----



More information about the use-livecode mailing list