mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09:43 +01:00
Guard PHYSFS_deinit() with PHYSFS_isInit()
A quick glance at PhysFS source code will show that PhysFS will bail if PHYSFS_deinit() is called if it's not initialized. "Bail" here just means setting an error code and returning early, so it's not that bad. Still, it's the principle of the thing, and I just want to ensure that FILESYSTEM_deinit() can be safely called no matter if the filesystem hasn't initialized yet; having an error set by PhysFS kind of taints the whole safety thing, even if it does nothing wrong, no? (although, speaking of which, we should be handling all errors by PhysFS, but that's for later...)
This commit is contained in:
parent
951e1653a6
commit
6077015fdc
1 changed files with 4 additions and 1 deletions
|
@ -133,9 +133,12 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath)
|
|||
}
|
||||
|
||||
void FILESYSTEM_deinit()
|
||||
{
|
||||
if (PHYSFS_isInit())
|
||||
{
|
||||
PHYSFS_deinit();
|
||||
}
|
||||
}
|
||||
|
||||
char *FILESYSTEM_getUserSaveDirectory()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue