From 966483be30edcf98fa6b67cf77bd6ed545d9a93a Mon Sep 17 00:00:00 2001 From: will Date: Thu, 30 Nov 2017 16:45:48 +0800 Subject: [PATCH] fix memory leak in FontFreeType::create (#18503) --- cocos/2d/CCFontFreeType.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 56dca6b18f..967262ef70 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -63,6 +63,7 @@ FontFreeType * FontFreeType::create(const std::string &fontName, float fontSize, delete tempFont; return nullptr; } + tempFont->autorelease(); return tempFont; }