Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

RenderState中的析构函数造成内存泄漏,已修复请查收

$
0
0

@wct511 写道:

我有两个模型 模型create的时候 下面这函数的CC_SAFE_RETAIN执行了7次 析构的时候只release执行了三次。
导致TextureCache中的texture无法释放。 rc每次都增加

void Mesh::setTexture(Texture2D* tex, NTextureData::Usage usage, bool cacheFileName)
{
// Texture must be saved for future use
// it doesn't matter if the material is already set or not
// This functionality is added for compatibility issues
if (tex == nullptr)
tex = getDummyTexture();

CC_SAFE_RETAIN(tex);
CC_SAFE_RELEASE(_textures[usage]);

帖子: 3

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>