mirror of https://github.com/axmolengine/axmol.git
Fixed crash
This commit is contained in:
parent
342c582124
commit
5076b9f008
|
@ -122,11 +122,9 @@ void FontAtlas::purgeTexturesAtlas()
|
||||||
FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);
|
FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);
|
||||||
if (fontTTf && _atlasTextures.size() > 1)
|
if (fontTTf && _atlasTextures.size() > 1)
|
||||||
{
|
{
|
||||||
_font->retain();
|
|
||||||
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
|
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
|
||||||
eventDispatcher->dispatchCustomEvent(CMD_PURGE_FONTATLAS,this);
|
eventDispatcher->dispatchCustomEvent(CMD_PURGE_FONTATLAS,this);
|
||||||
eventDispatcher->dispatchCustomEvent(CMD_RESET_FONTATLAS,this);
|
eventDispatcher->dispatchCustomEvent(CMD_RESET_FONTATLAS,this);
|
||||||
_font->release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,11 +133,9 @@ void FontAtlas::listenRendererRecreated(EventCustom *event)
|
||||||
FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);
|
FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);
|
||||||
if (fontTTf)
|
if (fontTTf)
|
||||||
{
|
{
|
||||||
_font->retain();
|
|
||||||
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
|
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
|
||||||
eventDispatcher->dispatchCustomEvent(CMD_PURGE_FONTATLAS,this);
|
eventDispatcher->dispatchCustomEvent(CMD_PURGE_FONTATLAS,this);
|
||||||
eventDispatcher->dispatchCustomEvent(CMD_RESET_FONTATLAS,this);
|
eventDispatcher->dispatchCustomEvent(CMD_RESET_FONTATLAS,this);
|
||||||
_font->release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue