Commit 749ac9c8 by Alexis Hetu Committed by Alexis Hétu

Release surface on releaseTexImage

The surface set during bindTexImage should be unset during releaseTexImage. Failing to do so may keep a dangling pointer to the surface, which can cause a crash later on (this was hit during the testing of new unit tests which will be added soon). Change-Id: Ic258fff8c880d449add825c5e9185435cc4ea419 Reviewed-on: https://swiftshader-review.googlesource.com/17548Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 2acbd268
......@@ -572,6 +572,12 @@ void Texture2D::releaseTexImage()
image[level] = nullptr;
}
}
if(mSurface)
{
mSurface->setBoundTexture(nullptr);
mSurface = nullptr;
}
}
void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment