Quantcast
Channel: Cocos中文社区 - 最新帖子
Viewing all articles
Browse latest Browse all 494966

CCMesh.cpp中的CC_SAFE_RETAIN造成材质缓存内存泄漏

$
0
0

我有两个模型 模型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]);

Viewing all articles
Browse latest Browse all 494966

Trending Articles



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