mirror of
https://github.com/u0u0/Cocos2d-Lua-Community.git
synced 2026-05-06 22:01:44 +08:00
修正xcode15错误,修正内存泄漏.
This commit is contained in:
@@ -125,11 +125,12 @@ FontAtlas::~FontAtlas()
|
||||
releaseTextures();
|
||||
|
||||
delete []_currentPageData;
|
||||
CC_SAFE_DELETE_ARRAY(_currentPageDataRGBA);
|
||||
|
||||
#if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID
|
||||
if (_iconv)
|
||||
{
|
||||
iconv_close(_iconv);
|
||||
iconv_close((iconv_t)_iconv);
|
||||
_iconv = nullptr;
|
||||
}
|
||||
#endif
|
||||
@@ -248,7 +249,7 @@ void FontAtlas::conversionU32TOGB2312(const std::u32string& u32Text, std::unorde
|
||||
#else
|
||||
if (_iconv == nullptr)
|
||||
{
|
||||
_iconv = iconv_open("GBK//TRANSLIT", "UTF-32LE");
|
||||
_iconv = (void *)iconv_open("GBK//TRANSLIT", "UTF-32LE");
|
||||
}
|
||||
|
||||
if (_iconv == (iconv_t)-1)
|
||||
@@ -262,7 +263,7 @@ void FontAtlas::conversionU32TOGB2312(const std::u32string& u32Text, std::unorde
|
||||
size_t inLen = strLen * 2;
|
||||
size_t outLen = gb2312StrSize;
|
||||
|
||||
iconv(_iconv, (char**)&pin, &inLen, &pout, &outLen);
|
||||
iconv((iconv_t)_iconv, (char**)&pin, &inLen, &pout, &outLen);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -17,10 +17,13 @@ function TestCase:ctor()
|
||||
-- btn event, fairy has it's own EventDispatcher, cover the cocos's node
|
||||
local btn = view:getChild("n9")
|
||||
btn:addEventListener(fairygui.UIEventType.Click, function(context)
|
||||
self.fairyRoot:release()
|
||||
-- XXX:场景切换的时候需要释放fairygui的静态数据,避免不必要的异常
|
||||
fairygui.HtmlObject:clearStaticPools()
|
||||
fairygui.DragDropManager:destroyInstance()
|
||||
-- 不能在fgui事件里面做删除自己等操作,内部会崩.
|
||||
self:performWithDelay(function()
|
||||
self.fairyRoot:release()
|
||||
-- XXX:场景切换的时候需要释放fairygui的静态数据,避免不必要的异常
|
||||
fairygui.HtmlObject:clearStaticPools()
|
||||
fairygui.DragDropManager:destroyInstance()
|
||||
end, 0)
|
||||
end)
|
||||
|
||||
local btnOpenWin = view:getChild("btnOpenWin")
|
||||
|
||||
Reference in New Issue
Block a user