WidgetCandy: Button(s) stop working after long sleep mode

Hi there,

I am using WidgetCandy in my current game and experienced the following odd behaviour on my iPhone 5: if I send my game to sleep mode and return to it after quite some time (e.g. one day later) some of my buttons do not respond to touches anymore, neither are they catched by display.remove() or any other image related functions anymore. It seems as if Corona is loosing a “handle” to my buttons.

This does not happen all the time and not to all of my buttons but it happens to 1 out of 3 custom buttons which are made with WidgetCandy. It is never the same button, it changes from time to time.

This is the code I am using for one of my buttons (the others look the same:)

-- draw "quit" button   
quit\_button = \_G.GUI.NewImage(display.newImageRect("images/"..gameData.language.."/quit.png", 75, 40),  
 {  
 x = left\_offset + 194 - scaleData.reducer\_18px + scaleData.reducer\_20px + scaleData.iPad1\_20px,  
 y = dropzones\_Y + 35 + scaleData.yLetterSpacer - scaleData.gamebuttonreducer,  
 width = 75,  
 height = 40,  
 parentGroup = nil,  
  
 onPress = function(EventData) EventData.Widget:setImage(display.newImageRect("images/"..gameData.language.."/quit\_down.png", 75, 40), false) end,  
 onRelease = function(EventData) EventData.Widget:setImage(display.newImageRect("images/"..gameData.language.."/quit.png", 75, 40), false) if EventData.inside and gameData.busy == false then quitGame() end end,  
 onDrag = function(EventData) end,  
 } )  

All of this does not happen when I return to my game from a short sleep mode (e.g. within a few minutes or hours).

Anyone encountered the same problem? I just do not know how to fix this!

Thanks,
Jens [import]uid: 101883 topic_id: 34465 reply_id: 334465[/import]