|
@@ -359,6 +359,9 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|
|
renderdata->glGenTextures(1, &data->texture);
|
|
|
result = renderdata->glGetError();
|
|
|
if (result != GL_NO_ERROR) {
|
|
|
+ if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
|
|
|
+ SDL_free(data->pixels);
|
|
|
+ }
|
|
|
SDL_free(data);
|
|
|
return GLES_SetError("glGenTextures()", result);
|
|
|
}
|
|
@@ -387,6 +390,9 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|
|
|
|
|
result = renderdata->glGetError();
|
|
|
if (result != GL_NO_ERROR) {
|
|
|
+ if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
|
|
|
+ SDL_free(data->pixels);
|
|
|
+ }
|
|
|
SDL_free(data);
|
|
|
return GLES_SetError("glTexImage2D()", result);
|
|
|
}
|