Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leaking of Texture2D at CCRenderTexture.cpp #20529

Open
sidepelican opened this issue May 29, 2020 · 0 comments · May be fixed by #20531
Open

Memory Leaking of Texture2D at CCRenderTexture.cpp #20529

sidepelican opened this issue May 29, 2020 · 0 comments · May be fixed by #20531

Comments

@sidepelican
Copy link
Contributor

auto texture = backend::Device::getInstance()->newTexture(descriptor);
if (! texture)
break;
_texture2D = new (std::nothrow) Texture2D();
if (_texture2D)
{
_texture2D->initWithBackendTexture(texture, CC_ENABLE_PREMULTIPLIED_ALPHA != 0);
_texture2D->setRenderTarget(true);
texture->release();
}
else
break;

the texture instance will leak at the statement of else break; .
should call texture->release(); each case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant