diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-10-15 09:08:09 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2022-10-15 09:26:58 -0400 |
commit | 12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69 (patch) | |
tree | b4885951a5cba1b78c21b30ce37a1d6f1574aa5f /apps/gui/skin_engine/skin_backdrops.c | |
parent | 9d3d925295112a0080bc1d70fad170db9e1af2a9 (diff) | |
download | rockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.tar.gz rockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.zip |
move buflib_free invalid handle check to the function
allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free
Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
Diffstat (limited to 'apps/gui/skin_engine/skin_backdrops.c')
-rw-r--r-- | apps/gui/skin_engine/skin_backdrops.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c index 146dccb18a..1def0812da 100644 --- a/apps/gui/skin_engine/skin_backdrops.c +++ b/apps/gui/skin_engine/skin_backdrops.c | |||
@@ -267,8 +267,7 @@ void skin_backdrop_unload(int backdrop_id) | |||
267 | backdrops[backdrop_id].ref_count--; | 267 | backdrops[backdrop_id].ref_count--; |
268 | if (backdrops[backdrop_id].ref_count <= 0) | 268 | if (backdrops[backdrop_id].ref_count <= 0) |
269 | { | 269 | { |
270 | if (backdrops[backdrop_id].buflib_handle > 0) | 270 | core_free(backdrops[backdrop_id].buflib_handle); |
271 | core_free(backdrops[backdrop_id].buflib_handle); | ||
272 | backdrops[backdrop_id].buffer = NULL; | 271 | backdrops[backdrop_id].buffer = NULL; |
273 | backdrops[backdrop_id].buflib_handle = -1; | 272 | backdrops[backdrop_id].buflib_handle = -1; |
274 | backdrops[backdrop_id].loaded = false; | 273 | backdrops[backdrop_id].loaded = false; |