开发者

cocos2d iphone game crashes on restart

I am currently making a game for the iphone using cocos2d.

The game runs perfectly until I try to restart the program. If I exit, end the app (double click on the home button and then delete the game icon from the currently running apps bar), and then relaunch, it gives an error. If I exit and relaunch without ending the program, it resumes where it left off. I have yet to test this on an actual iphone, only the simula开发者_开发问答tor. It does not crash the first time the app starts. can anyone help?

this is the line that the program crashed on : (it's from main.m)

int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

with the following error: Thread 1: program received signal: "SIGKILL"

here's the output:

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)

Copyright 2004 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.

There is absolutely no warranty for GDB.  Type "show warranty" for details.

This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all

Attaching to process 75619.

2011-07-07 10:02:21.765 Mellow Adventures[75619:207] cocos2d: cocos2d v1.0.0-beta

2011-07-07 10:02:21.767 Mellow Adventures[75619:207] cocos2d: Using Director Type:CCDirectorDisplayLink

2011-07-07 10:02:21.843 Mellow Adventures[75619:207] cocos2d: OS version: 4.3.2 (0x04030200)

2011-07-07 10:02:21.844 Mellow Adventures[75619:207] cocos2d: GL_VENDOR:   Apple Computer, Inc.

2011-07-07 10:02:21.845 Mellow Adventures[75619:207] cocos2d: GL_RENDERER: Apple Software Renderer

2011-07-07 10:02:21.845 Mellow Adventures[75619:207] cocos2d: GL_VERSION:  OpenGL ES-CM 1.1 APPLE

2011-07-07 10:02:21.846 Mellow Adventures[75619:207] cocos2d: GL_MAX_TEXTURE_SIZE: 2048

2011-07-07 10:02:21.849 Mellow Adventures[75619:207] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16

2011-07-07 10:02:21.850 Mellow Adventures[75619:207] cocos2d: GL_MAX_SAMPLES: 4

2011-07-07 10:02:21.851 Mellow Adventures[75619:207] cocos2d: GL supports PVRTC: YES

2011-07-07 10:02:21.853 Mellow Adventures[75619:207] cocos2d: GL supports BGRA8888 textures: YES

2011-07-07 10:02:21.854 Mellow Adventures[75619:207] cocos2d: GL supports NPOT textures: YES

2011-07-07 10:02:21.854 Mellow Adventures[75619:207] cocos2d: GL supports discard_framebuffer: YES

2011-07-07 10:02:21.855 Mellow Adventures[75619:207] cocos2d: compiled with NPOT support: NO

2011-07-07 10:02:21.856 Mellow Adventures[75619:207] cocos2d: compiled with VBO support in TextureAtlas : YES

2011-07-07 10:02:21.857 Mellow Adventures[75619:207] cocos2d: compiled with Affine Matrix transformation in CCNode : YES

2011-07-07 10:02:21.858 Mellow Adventures[75619:207] cocos2d: compiled with Profiling Support: NO

2011-07-07 10:02:21.880 Mellow Adventures[75619:207] cocos2d: surface size: 480x320

[Switching to process 75619 thread 0x580b]

AudioStreamBasicDescription:  2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved

[Switching to process 75619 thread 0x207]

2011-07-07 10:02:23.419 Mellow Adventures[75619:207] cocos2d: Frame interval: 1

2011-07-07 10:02:30.265 Mellow Adventures[75619:207] cocos2d: Frame interval: 15

2011-07-07 10:02:32.587 Mellow Adventures[75619:207] cocos2d: Frame interval: 15

2011-07-07 10:02:32.589 Mellow Adventures[75619:207] cocos2d: Frame interval: 1

2011-07-07 10:02:35.239 Mellow Adventures[75619:207] cocos2d: Frame interval: 15

Current language:  auto; currently objective-c

(gdb)


I've found in Xcode 4, for any app, if you are running with breakpoints allowed (debug mode), and then go to home screen, and close the app (double click home button etc), and then try to start it from home screen (all without stopping the current xcode debug session), it freaks out (even after you hit continue in the debugger from the SIGKILL for you closing your app). I wouldn't worry about it for now if it resumes fine and starts the first time fine.

This also appears to happen if you are debugging on a device (plugged in using Xcode), but if you unplug the device and try to replicate the issue as a stand alone, it works fine.

I haven't submitted it to apple, but please feel free to. :)


Use NSZombieEnabled in your build environment for more information on this crash.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜