2010-12-11 84 views
0

我在myApp中遇到了一个我正在开发的问题。我正在使用CCSpriteSheet来移动屏幕上的对象,对象随机移动,并在一段时间后从屏幕上移除。当大量物体进入和移除状态很重时,崩溃通常会发生,而且它完全是随机的。我在代码中没有任何泄漏,发生的次数通常非常少,但在第一次出现时会增加。任何形式的帮助将不胜感激。CCSpriteSheet随机崩溃绘制

我使用cocos2d的v 0.99.4/0.99.5rc0,Xcode的SDK:4.0/4.1

CRASH:

Exception Type: EXC_BAD_ACCESS (SIGBUS) 
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000004 
Crashed Thread: 0 

Thread 0 Crashed: 
0 IMGSGX535GLDriver     0x0001f462 glrRenderVertexArray + 406 
1 GLEngine       0x0002c138 gleExecuteVertexArrayRange + 100 
2 GLEngine       0x0002db0a glDrawElements_ACC_Exec + 270 
3 OpenGLES       0x00003334 glDrawElements + 32 
4 myApp       0x000cfca6 -[CCTextureAtlas drawNumberOfQuads:] (CCTextureAtlas.m:306) 
5 myApp       0x000cf560 -[CCTextureAtlas drawQuads] (CCTextureAtlas.m:277) 
6 myApp       0x000cdb42 -[CCSpriteSheet draw] (CCSpriteSheet.m:291) 
7 myApp       0x000cd9ee -[CCSpriteSheet visit] (CCSpriteSheet.m:147) 
8 myApp       0x000b97c2 -[CCNode visit] (CCNode.m:486) 
9 myApp       0x00062e3c -[myAppGameLayer visit] (myAppGameLayer.m:38) 
10 myApp       0x000b97c2 -[CCNode visit] (CCNode.m:486) 
11 myApp       0x000a7c96 -[CCDirector drawScene] (CCDirector.m:253) 
12 myApp       0x000a673e -[CCDisplayLinkDirector preMainLoop:] (CCDirector.m:1212) 
13 QuartzCore      0x000926fc CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long) + 144 
14 QuartzCore      0x00092820 CA::Display::IOMFBDisplayLink::callback(__IOMobileFramebuffer*, unsigned long long, unsigned long long, unsigned long long, void*) + 44 
15 IOMobileFramebuffer    0x00001bf4 IOMobileFramebufferVsyncNotifyFunc + 68 
16 ???        0x35079040 0 + 889688128 
17 CoreFoundation     0x0003d30c __CFMachPortPerform + 204 
18 CoreFoundation     0x00034cdc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20 
19 CoreFoundation     0x00034ca0 __CFRunLoopDoSource1 + 160 
20 CoreFoundation     0x00027566 __CFRunLoopRun + 514 
21 CoreFoundation     0x00027270 CFRunLoopRunSpecific + 224 
22 CoreFoundation     0x00027178 CFRunLoopRunInMode + 52 
23 GraphicsServices     0x000045ec GSEventRunModal + 108 
24 GraphicsServices     0x00004698 GSEventRun + 56 
25 UIKit        0x0000411c -[UIApplication _run] + 396 
26 UIKit        0x00002128 UIApplicationMain + 664 
27 myApp       0x00002904 main (main.m:13) 
28 myApp       0x000028a8 start + 44 

回答

1

这样看来,您要引用已物体释放。