diff --git a/cocos/renderer/CCFrameBuffer.cpp b/cocos/renderer/CCFrameBuffer.cpp index 7d679261bd..fbff5ed432 100644 --- a/cocos/renderer/CCFrameBuffer.cpp +++ b/cocos/renderer/CCFrameBuffer.cpp @@ -397,7 +397,6 @@ FrameBuffer::FrameBuffer() FrameBuffer::~FrameBuffer() { - if(!isDefaultFBO()) { CC_SAFE_RELEASE_NULL(_rt); CC_SAFE_RELEASE_NULL(_rtDepthStencil); @@ -407,6 +406,8 @@ FrameBuffer::~FrameBuffer() #if CC_ENABLE_CACHE_TEXTURE_DATA Director::getInstance()->getEventDispatcher()->removeEventListener(_dirtyFBOListener); #endif + if (isDefaultFBO()) + _defaultFBO = nullptr; } }