mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
gl_engine: hotfix memory leak
issue: https://github.com/thorvg/thorvg/issues/3140
This commit is contained in:
parent
5752e75ff9
commit
b79d12a04d
2 changed files with 9 additions and 6 deletions
|
@ -45,7 +45,7 @@ static void _termEngine()
|
|||
}
|
||||
|
||||
|
||||
void GlRenderer::flush()
|
||||
void GlRenderer::clearDisposes()
|
||||
{
|
||||
if (mDisposed.textures.count > 0) {
|
||||
glDeleteTextures(mDisposed.textures.count, mDisposed.textures.data);
|
||||
|
@ -53,19 +53,21 @@ void GlRenderer::flush()
|
|||
}
|
||||
|
||||
ARRAY_FOREACH(p, mRenderPassStack) delete(*p);
|
||||
|
||||
mRenderPassStack.clear();
|
||||
}
|
||||
|
||||
|
||||
void GlRenderer::flush()
|
||||
{
|
||||
clearDisposes();
|
||||
|
||||
ARRAY_FOREACH(p, mComposePool) delete(*p);
|
||||
|
||||
mComposePool.clear();
|
||||
|
||||
ARRAY_FOREACH(p, mBlendPool) delete(*p);
|
||||
|
||||
mBlendPool.clear();
|
||||
|
||||
ARRAY_FOREACH(p, mComposeStack) delete(*p);
|
||||
|
||||
mComposeStack.clear();
|
||||
}
|
||||
|
||||
|
@ -850,7 +852,7 @@ bool GlRenderer::sync()
|
|||
|
||||
GL_CHECK(glDisable(GL_SCISSOR_TEST));
|
||||
|
||||
flush();
|
||||
clearDisposes();
|
||||
|
||||
delete task;
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ private:
|
|||
void endRenderPass(RenderCompositor* cmp);
|
||||
|
||||
void flush();
|
||||
void clearDisposes();
|
||||
void currentContext();
|
||||
|
||||
void* mContext = nullptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue