fix #188 , make eglDestroyContext after glDeleteTexture

This commit is contained in:
Walzer 2010-11-03 06:47:23 +00:00
parent b06f84d332
commit 200080aea0
2 changed files with 7 additions and 6 deletions

View File

@ -193,10 +193,10 @@ CCXEGLView::CCXEGLView(TApplication * pApp)
CCXEGLView::~CCXEGLView() CCXEGLView::~CCXEGLView()
{ {
delete m_pEGL; CCX_SAFE_DELETE(m_pSet);
delete m_pSet; CCX_SAFE_DELETE(m_pTouch);
delete m_pTouch;
CCX_SAFE_DELETE(m_pDelegate); CCX_SAFE_DELETE(m_pDelegate);
CCX_SAFE_DELETE(m_pEGL);
} }
Boolean CCXEGLView::AfterCreate(void) Boolean CCXEGLView::AfterCreate(void)
@ -293,7 +293,6 @@ bool CCXEGLView::isOpenGLReady()
void CCXEGLView::release() void CCXEGLView::release()
{ {
CCX_SAFE_DELETE(m_pEGL);
CloseWindow(); CloseWindow();
} }

View File

@ -43,7 +43,7 @@ THE SOFTWARE.
#include "CCPVRTexture.h" #include "CCPVRTexture.h"
#endif #endif
namespace cocos2d { namespace cocos2d {
#if CC_FONT_LABEL_SUPPORT #if CC_FONT_LABEL_SUPPORT
// FontLabel support // FontLabel support
@ -77,7 +77,9 @@ CCTexture2D::~CCTexture2D()
{ {
CCLOGINFO("cocos2d: deallocing CCTexture2D %u.", m_uName); CCLOGINFO("cocos2d: deallocing CCTexture2D %u.", m_uName);
if(m_uName) if(m_uName)
{
glDeleteTextures(1, &m_uName); glDeleteTextures(1, &m_uName);
}
} }
CCTexture2DPixelFormat CCTexture2D::getPixelFormat() CCTexture2DPixelFormat CCTexture2D::getPixelFormat()
@ -603,4 +605,4 @@ CCTexture2DPixelFormat CCTexture2D::defaultAlphaPixelFormat()
return g_defaultAlphaPixelFormat; return g_defaultAlphaPixelFormat;
} }
}//namespace cocos2d }//namespace cocos2d