mirror of
https://github.com/encounter/SDL.git
synced 2025-12-10 22:17:59 +00:00
Christoph Mallon: Remove pointless if (x) before SDL_free(x)
This commit is contained in:
@@ -1712,9 +1712,7 @@ SDL_DestroyTexture(SDL_Texture * texture)
|
||||
if (texture->yuv) {
|
||||
SDL_SW_DestroyYUVTexture(texture->yuv);
|
||||
}
|
||||
if (texture->pixels) {
|
||||
SDL_free(texture->pixels);
|
||||
}
|
||||
SDL_free(texture->pixels);
|
||||
|
||||
renderer->DestroyTexture(renderer, texture);
|
||||
SDL_free(texture);
|
||||
|
||||
@@ -1335,15 +1335,9 @@ void
|
||||
SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
|
||||
{
|
||||
if (swdata) {
|
||||
if (swdata->pixels) {
|
||||
SDL_free(swdata->pixels);
|
||||
}
|
||||
if (swdata->colortab) {
|
||||
SDL_free(swdata->colortab);
|
||||
}
|
||||
if (swdata->rgb_2_pix) {
|
||||
SDL_free(swdata->rgb_2_pix);
|
||||
}
|
||||
SDL_free(swdata->pixels);
|
||||
SDL_free(swdata->colortab);
|
||||
SDL_free(swdata->rgb_2_pix);
|
||||
if (swdata->stretch) {
|
||||
SDL_FreeSurface(swdata->stretch);
|
||||
}
|
||||
|
||||
@@ -1813,9 +1813,7 @@ D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
if (data->vtexture) {
|
||||
IDirect3DTexture9_Release(data->vtexture);
|
||||
}
|
||||
if (data->pixels) {
|
||||
SDL_free(data->pixels);
|
||||
}
|
||||
SDL_free(data->pixels);
|
||||
SDL_free(data);
|
||||
texture->driverdata = NULL;
|
||||
}
|
||||
|
||||
@@ -1318,9 +1318,7 @@ GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
renderdata->glDeleteTextures(1, &data->utexture);
|
||||
renderdata->glDeleteTextures(1, &data->vtexture);
|
||||
}
|
||||
if (data->pixels) {
|
||||
SDL_free(data->pixels);
|
||||
}
|
||||
SDL_free(data->pixels);
|
||||
SDL_free(data);
|
||||
texture->driverdata = NULL;
|
||||
}
|
||||
|
||||
@@ -573,9 +573,7 @@ GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
data->format,
|
||||
data->formattype,
|
||||
src);
|
||||
if (blob) {
|
||||
SDL_free(blob);
|
||||
}
|
||||
SDL_free(blob);
|
||||
|
||||
if (renderdata->glGetError() != GL_NO_ERROR)
|
||||
{
|
||||
@@ -1116,9 +1114,7 @@ GLES_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
if (data->texture) {
|
||||
renderdata->glDeleteTextures(1, &data->texture);
|
||||
}
|
||||
if (data->pixels) {
|
||||
SDL_free(data->pixels);
|
||||
}
|
||||
SDL_free(data->pixels);
|
||||
SDL_free(data);
|
||||
texture->driverdata = NULL;
|
||||
}
|
||||
|
||||
@@ -336,9 +336,7 @@ GLES2_DestroyRenderer(SDL_Renderer *renderer)
|
||||
}
|
||||
SDL_GL_DeleteContext(rdata->context);
|
||||
}
|
||||
if (rdata->shader_formats) {
|
||||
SDL_free(rdata->shader_formats);
|
||||
}
|
||||
SDL_free(rdata->shader_formats);
|
||||
SDL_free(rdata);
|
||||
}
|
||||
SDL_free(renderer);
|
||||
@@ -541,9 +539,7 @@ GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect
|
||||
tdata->pixel_format,
|
||||
tdata->pixel_type,
|
||||
src);
|
||||
if (blob) {
|
||||
SDL_free(blob);
|
||||
}
|
||||
SDL_free(blob);
|
||||
|
||||
if (rdata->glGetError() != GL_NO_ERROR) {
|
||||
return SDL_SetError("Failed to update texture");
|
||||
|
||||
@@ -988,10 +988,7 @@ PSP_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
if(psp_texture == 0)
|
||||
return;
|
||||
|
||||
if(psp_texture->data != 0)
|
||||
{
|
||||
SDL_free(psp_texture->data);
|
||||
}
|
||||
SDL_free(psp_texture->data);
|
||||
SDL_free(psp_texture);
|
||||
texture->driverdata = NULL;
|
||||
}
|
||||
|
||||
@@ -718,9 +718,7 @@ SW_DestroyRenderer(SDL_Renderer * renderer)
|
||||
{
|
||||
SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
|
||||
|
||||
if (data) {
|
||||
SDL_free(data);
|
||||
}
|
||||
SDL_free(data);
|
||||
SDL_free(renderer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user