mirror of https://github.com/axmolengine/axmol.git
Revert "Ensure font atlas is correctly released even if it does not exist in the atlas cache."
This reverts commit 8b27fdb832
.
This commit is contained in:
parent
8b27fdb832
commit
b60478ac90
|
@ -540,11 +540,7 @@ Label::~Label()
|
||||||
Node::removeAllChildrenWithCleanup(true);
|
Node::removeAllChildrenWithCleanup(true);
|
||||||
CC_SAFE_RELEASE_NULL(_reusedLetter);
|
CC_SAFE_RELEASE_NULL(_reusedLetter);
|
||||||
_batchNodes.clear();
|
_batchNodes.clear();
|
||||||
if (!FontAtlasCache::releaseFontAtlas(_fontAtlas))
|
FontAtlasCache::releaseFontAtlas(_fontAtlas);
|
||||||
{
|
|
||||||
_fontAtlas->release();
|
|
||||||
}
|
|
||||||
_fontAtlas = nullptr;
|
|
||||||
}
|
}
|
||||||
_batchCommands.clear();
|
_batchCommands.clear();
|
||||||
_eventDispatcher->removeEventListener(_purgeTextureListener);
|
_eventDispatcher->removeEventListener(_purgeTextureListener);
|
||||||
|
@ -566,10 +562,7 @@ void Label::reset()
|
||||||
_lettersInfo.clear();
|
_lettersInfo.clear();
|
||||||
if (_fontAtlas)
|
if (_fontAtlas)
|
||||||
{
|
{
|
||||||
if (!FontAtlasCache::releaseFontAtlas(_fontAtlas))
|
FontAtlasCache::releaseFontAtlas(_fontAtlas);
|
||||||
{
|
|
||||||
_fontAtlas->release();
|
|
||||||
}
|
|
||||||
_fontAtlas = nullptr;
|
_fontAtlas = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,10 +790,7 @@ void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false *
|
||||||
if (_fontAtlas)
|
if (_fontAtlas)
|
||||||
{
|
{
|
||||||
_batchNodes.clear();
|
_batchNodes.clear();
|
||||||
if (!FontAtlasCache::releaseFontAtlas(_fontAtlas))
|
FontAtlasCache::releaseFontAtlas(_fontAtlas);
|
||||||
{
|
|
||||||
_fontAtlas->release();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_fontAtlas = atlas;
|
_fontAtlas = atlas;
|
||||||
|
|
||||||
|
@ -1633,10 +1623,7 @@ void Label::updateContent()
|
||||||
_batchNodes.clear();
|
_batchNodes.clear();
|
||||||
_batchCommands.clear();
|
_batchCommands.clear();
|
||||||
CC_SAFE_RELEASE_NULL(_reusedLetter);
|
CC_SAFE_RELEASE_NULL(_reusedLetter);
|
||||||
if (!FontAtlasCache::releaseFontAtlas(_fontAtlas))
|
FontAtlasCache::releaseFontAtlas(_fontAtlas);
|
||||||
{
|
|
||||||
_fontAtlas->release();
|
|
||||||
}
|
|
||||||
_fontAtlas = nullptr;
|
_fontAtlas = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue