PHYSFS_freeList(NULL) is now a safe no-op.
This commit is contained in:
parent
b78da18657
commit
fb5e8d9cd2
|
@ -872,10 +872,13 @@ const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void)
|
||||||
void PHYSFS_freeList(void *list)
|
void PHYSFS_freeList(void *list)
|
||||||
{
|
{
|
||||||
void **i;
|
void **i;
|
||||||
|
if (list != NULL)
|
||||||
|
{
|
||||||
for (i = (void **) list; *i != NULL; i++)
|
for (i = (void **) list; *i != NULL; i++)
|
||||||
allocator.Free(*i);
|
allocator.Free(*i);
|
||||||
|
|
||||||
allocator.Free(list);
|
allocator.Free(list);
|
||||||
|
} /* if */
|
||||||
} /* PHYSFS_freeList */
|
} /* PHYSFS_freeList */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -550,7 +550,11 @@ __EXPORT__ const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void);
|
||||||
* Certain PhysicsFS functions return lists of information that are
|
* Certain PhysicsFS functions return lists of information that are
|
||||||
* dynamically allocated. Use this function to free those resources.
|
* dynamically allocated. Use this function to free those resources.
|
||||||
*
|
*
|
||||||
|
* It is safe to pass a NULL here, but doing so will cause a crash in versions
|
||||||
|
* before PhysicsFS 2.1.0.
|
||||||
|
*
|
||||||
* \param listVar List of information specified as freeable by this function.
|
* \param listVar List of information specified as freeable by this function.
|
||||||
|
* Passing NULL is safe; it is a valid no-op.
|
||||||
*
|
*
|
||||||
* \sa PHYSFS_getCdRomDirs
|
* \sa PHYSFS_getCdRomDirs
|
||||||
* \sa PHYSFS_enumerateFiles
|
* \sa PHYSFS_enumerateFiles
|
||||||
|
|
Loading…
Reference in New Issue