diff --git a/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp b/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp index bcc1df850d..f6cadc3692 100644 --- a/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp +++ b/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp @@ -193,10 +193,10 @@ CCXEGLView::CCXEGLView(TApplication * pApp) CCXEGLView::~CCXEGLView() { - delete m_pEGL; - delete m_pSet; - delete m_pTouch; + CCX_SAFE_DELETE(m_pSet); + CCX_SAFE_DELETE(m_pTouch); CCX_SAFE_DELETE(m_pDelegate); + CCX_SAFE_DELETE(m_pEGL); } Boolean CCXEGLView::AfterCreate(void) @@ -293,7 +293,6 @@ bool CCXEGLView::isOpenGLReady() void CCXEGLView::release() { - CCX_SAFE_DELETE(m_pEGL); CloseWindow(); } diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index 2fee19d1e4..9482f6fc86 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -43,7 +43,7 @@ THE SOFTWARE. #include "CCPVRTexture.h" #endif -namespace cocos2d { +namespace cocos2d { #if CC_FONT_LABEL_SUPPORT // FontLabel support @@ -77,7 +77,9 @@ CCTexture2D::~CCTexture2D() { CCLOGINFO("cocos2d: deallocing CCTexture2D %u.", m_uName); if(m_uName) + { glDeleteTextures(1, &m_uName); + } } CCTexture2DPixelFormat CCTexture2D::getPixelFormat() @@ -603,4 +605,4 @@ CCTexture2DPixelFormat CCTexture2D::defaultAlphaPixelFormat() return g_defaultAlphaPixelFormat; } -}//namespace cocos2d +}//namespace cocos2d