From 0d7a5cd093397ebae5c06c55e824a871c04548ff Mon Sep 17 00:00:00 2001 From: xebra Date: Mon, 8 Oct 2018 00:29:41 +0900 Subject: [PATCH] GLES: Fix to delete subimage data since #11447. --- ext/native/thin3d/GLQueueRunner.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ext/native/thin3d/GLQueueRunner.cpp b/ext/native/thin3d/GLQueueRunner.cpp index 5db058262a1e..7349a2d62586 100644 --- a/ext/native/thin3d/GLQueueRunner.cpp +++ b/ext/native/thin3d/GLQueueRunner.cpp @@ -490,7 +490,19 @@ void GLQueueRunner::RunSteps(const std::vector &steps, bool skipGLCal const GLRStep &step = *steps[i]; switch (step.stepType) { case GLRStepType::RENDER: - // TODO: With #11425 there'll be a case where we should really free spline data here. + for (const auto &c : step.commands) { + switch (c.cmd) { + case GLRRenderCommand::TEXTURE_SUBIMAGE: + if (c.texture_subimage.data) { + if (c.texture_subimage.allocType == GLRAllocType::ALIGNED) { + FreeAlignedMemory(c.texture_subimage.data); + } else if (c.texture_subimage.allocType == GLRAllocType::NEW) { + delete[] c.texture_subimage.data; + } + } + break; + } + } break; } delete steps[i];