game crash..., could somebody give some suggestion?

hello everybody:
I run game, when i touch ipod touch button( i want to close game), game crash…

the crash debug info is that:

  • (void) swapBuffers
    {
    // IMPORTANT:
    // - preconditions
    // > context_ MUST be the OpenGL context
    //
    > renderbuffer_ must be the the RENDER BUFFER

#ifdef __IPHONE_4_0

if (multiSampling_)
{
/* Resolve from msaaFramebuffer to resolveFramebuffer */
//glDisable(GL_SCISSOR_TEST);
glBindFramebufferOES(GL_READ_FRAMEBUFFER_APPLE, [renderer_ msaaFrameBuffer]);
glBindFramebufferOES(GL_DRAW_FRAMEBUFFER_APPLE, [renderer_ defaultFrameBuffer]);
glResolveMultisampleFramebufferAPPLE();
}

if( discardFramebufferSupported_)
{
if (multiSampling_)
{
if (depthFormat_)
{
GLenum attachments[] = {GL_COLOR_ATTACHMENT0_OES, GL_DEPTH_ATTACHMENT_OES};
glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 2, attachments);
}
else
{
GLenum attachments[] = {GL_COLOR_ATTACHMENT0_OES};
glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 1, attachments);
}

glBindRenderbufferOES(GL_RENDERBUFFER_OES, [renderer_ colorRenderBuffer]);

}

// not MSAA
else if (depthFormat_ ) {
GLenum attachments[] = { GL_DEPTH_ATTACHMENT_OES};
glDiscardFramebufferEXT(GL_FRAMEBUFFER_OES, 1, attachments);
}
}

#endif // __IPHONE_4_0

if(![context_ presentRenderbuffer:GL_RENDERBUFFER_OES])
{
// CCLOG (@“cocos2d: Failed to swap renderbuffer in %s\n”, __FUNCTION__);
}

#if COCOS2D_DEBUG
CHECK_GL_ERROR();
#endif

// We can safely re-bind the framebuffer here, since this will be the
// 1st instruction of the new main loop
if( multiSampling_ )
glBindFramebufferOES(GL_FRAMEBUFFER_OES, [renderer_ msaaFrameBuffer]);

bug stop here:

if(![context_ presentRenderbuffer:GL_RENDERBUFFER_OES])
{
// CCLOG (@“cocos2d: Failed to swap renderbuffer in %s\n”, __FUNCTION__);
}

any suggestions are appreicate:)


crash file.jpg (103.3 KB)