touchEvent bug

Hi,

Sometimes my app crashes when I’m changing scene with Storyboard and Director. It happens both before the scene is changes and after. The app crashes after a touchEvent. This is the device log:

Identifier: Game
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2011-12-16 10:36:45.627 +0100
OS Version: iPhone OS 5.0 (9A334)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000007
Crashed Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 Game 0x00054998 0x1000 + 342424
1 Game 0x000563cc 0x1000 + 349132
2 Game 0x00057256 0x1000 + 352854
3 Game 0x0004ad44 0x1000 + 302404
4 Game 0x000448b2 0x1000 + 276658
5 Game 0x0004a574 0x1000 + 300404
6 Game 0x0004af5e 0x1000 + 302942
7 Game 0x0004488c 0x1000 + 276620
8 Game 0x000658c6 0x1000 + 411846
9 Game 0x0005fa5e 0x1000 + 387678
10 Game 0x00062414 0x1000 + 398356
11 Game 0x000627b6 0x1000 + 399286
12 Game 0x000624e8 0x1000 + 398568
13 Game 0x00062760 0x1000 + 399200
14 Game 0x00075efe 0x1000 + 478974
15 Game 0x00012ebc 0x1000 + 73404
16 Game 0x00013714 0x1000 + 75540
17 CoreFoundation 0x3500742e -[NSObject performSelector:withObject:withObject:] + 46
18 UIKit 0x374b7738 forwardTouchMethod + 228
19 CoreFoundation 0x3500742e -[NSObject performSelector:withObject:withObject:] + 46
20 UIKit 0x374b7738 forwardTouchMethod + 228
21 UIKit 0x373b3508 -[UIWindow _sendTouchesForEvent:] + 312
22 UIKit 0x373b2efa -[UIWindow sendEvent:] + 374
23 UIKit 0x373994e6 -[UIApplication sendEvent:] + 350
24 UIKit 0x37398d26 _UIApplicationHandleEvent + 5802
25 GraphicsServices 0x31aeee0c PurpleEventCallback + 876
26 CoreFoundation 0x3508154c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
27 CoreFoundation 0x350814ee __CFRunLoopDoSource1 + 134
28 CoreFoundation 0x3508033c __CFRunLoopRun + 1364
29 CoreFoundation 0x350034d6 CFRunLoopRunSpecific + 294
30 CoreFoundation 0x3500339e CFRunLoopRunInMode + 98
31 GraphicsServices 0x31aedfe6 GSEventRunModal + 150
32 UIKit 0x373c773c UIApplicationMain + 1084
33 Game 0x00003400 0x1000 + 9216
34 Game 0x000033b8 0x1000 + 9144
[import]uid: 88922 topic_id: 19226 reply_id: 319226[/import]

Are you using physics? Can you explain a bit about what is going on immediately before/after the scene change? [import]uid: 52491 topic_id: 19226 reply_id: 74168[/import]

Yes, I’m using physics. The physic starts in createScene() and stops in exitScene(). This is how we handle the physic:

  
function scene:createScene( event )  
-- Start physics  
-- Add display objects  
end  
  
function scene:enterScene( event )  
 storyboard.removeAll()  
end  
  
function scene:exitScene( event )  
 currentLevel:clean() -- remove listeners, timers and stop physic  
 currentLevel:cleanGroups() -- Run removeSelf on all display objects  
end  

Thank you for helping:-) [import]uid: 88922 topic_id: 19226 reply_id: 74173[/import]

I’m curious as to whether or not the issue is being caused by physics, it seems to be the main issue with things like this.

When the scene changes are any of your physics objects in a collision? [import]uid: 52491 topic_id: 19226 reply_id: 74310[/import]