Doesn't grab mutex in __PHYSFS_setError() if PHYSFS_init() hasn't been called.

This commit is contained in:
Ryan C. Gordon 2002-04-08 13:35:29 +00:00
parent 860e348dac
commit 7ffd15fb42
1 changed files with 6 additions and 2 deletions

View File

@ -107,7 +107,9 @@ static ErrMsg *findErrorForCurrentThread(void)
ErrMsg *i;
PHYSFS_uint64 tid;
__PHYSFS_platformGrabMutex(errorLock);
if (initialized)
__PHYSFS_platformGrabMutex(errorLock);
if (errorMessages != NULL)
{
tid = __PHYSFS_platformGetThreadID();
@ -121,7 +123,9 @@ static ErrMsg *findErrorForCurrentThread(void)
} /* if */
} /* for */
} /* if */
__PHYSFS_platformReleaseMutex(errorLock);
if (initialized)
__PHYSFS_platformReleaseMutex(errorLock);
return(NULL); /* no error available. */
} /* findErrorForCurrentThread */