diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index 8160c4a338af..905f1122baec 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -750,6 +750,7 @@ void VolatileTextureMgr::addImage(Texture2D *tt, Image *image) VolatileTexture *vt = findVolotileTexture(tt); image->retain(); + CC_SAFE_RELEASE_NULL(vt->_uiImage); vt->_uiImage = image; vt->_cashedImageType = VolatileTexture::kImage; vt->_pixelFormat = tt->getPixelFormat(); diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 72e604eb2ed0..460c7ab461b3 100755 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -639,7 +639,7 @@ void MyXMLVisitor::startElement(void* /*ctx*/, const char *elementName, const ch auto result = tagBehavior.handleVisitEnter(tagAttrValueMap); ValueMap& attrValueMap = result.first; RichElement* richElement = result.second; - if (!attrValueMap.empty()) { + if (tagBehavior.isFontElement){ Attributes attributes; if (attrValueMap.find(RichText::KEY_FONT_SIZE) != attrValueMap.end()) {