mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-06 21:25:03 -05:00
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
This commit is contained in:
parent
9d3d925295
commit
12ef045fdf
18 changed files with 32 additions and 62 deletions
|
|
@ -75,10 +75,7 @@ int xf_nandio_init(struct xf_nandio* nio)
|
|||
|
||||
void xf_nandio_destroy(struct xf_nandio* nio)
|
||||
{
|
||||
if(nio->alloc_handle > 0) {
|
||||
core_free(nio->alloc_handle);
|
||||
nio->alloc_handle = 0;
|
||||
}
|
||||
nio->alloc_handle = core_free(nio->alloc_handle);
|
||||
|
||||
if(nio->ndrv) {
|
||||
nand_lock(nio->ndrv);
|
||||
|
|
|
|||
|
|
@ -257,8 +257,5 @@ void xf_package_close(struct xf_package* pkg)
|
|||
if(mtar_is_open(pkg->tar))
|
||||
mtar_close(pkg->tar);
|
||||
|
||||
if(pkg->alloc_handle > 0) {
|
||||
core_free(pkg->alloc_handle);
|
||||
pkg->alloc_handle = 0;
|
||||
}
|
||||
pkg->alloc_handle = core_free(pkg->alloc_handle);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue