diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp index bc686d0521..c687288d3d 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -52,6 +52,9 @@ TextureAtlas::TextureAtlas() ,_dirty(false) ,_texture(nullptr) ,_quads(nullptr) +#if CC_ENABLE_CACHE_TEXTURE_DATA + ,_backToForegroundlistener(nullptr) +#endif {} TextureAtlas::~TextureAtlas() diff --git a/cocos/2d/CCTextureAtlas.h b/cocos/2d/CCTextureAtlas.h index a20a41542a..09cc0769f5 100644 --- a/cocos/2d/CCTextureAtlas.h +++ b/cocos/2d/CCTextureAtlas.h @@ -238,7 +238,9 @@ protected: /** Quads that are going to be rendered */ V3F_C4B_T2F_Quad* _quads; +#if CC_ENABLE_CACHE_TEXTURE_DATA EventListenerCustom* _backToForegroundlistener; +#endif }; // end of textures group diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 9d621cad05..4b31b03650 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -47,7 +47,9 @@ Renderer::Renderer() ,_lastCommand(0) ,_numQuads(0) ,_glViewAssigned(false) +#if CC_ENABLE_CACHE_TEXTURE_DATA ,_cacheTextureListener(nullptr) +#endif { _commandGroupStack.push(DEFAULT_RENDER_QUEUE);