From 91e1d488492a89fc190a41da6fc5300f606205c2 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 1 Mar 2021 14:01:10 +0300
Subject: [PATCH] RWops12to20_close: don't check for error before freeing
rwops20
SDL-1.2 always returns 0 from RWclose (and so does SDL2.)
---
src/SDL12_compat.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 7b58a66..79238dc 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -4387,12 +4387,10 @@ static int SDLCALL
RWops12to20_close(struct SDL_RWops *rwops20)
{
int rc = 0;
- if (rwops20)
- {
+ if (rwops20) {
SDL12_RWops *rwops12 = (SDL12_RWops *) rwops20->hidden.unknown.data1;
rc = rwops12->close(rwops12);
- if (rc == 0)
- SDL20_FreeRW(rwops20);
+ SDL20_FreeRW(rwops20);
}
return rc;
}