From 7ffd15fb4207e5e2d539a5366c53b181b9d4cb01 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 8 Apr 2002 13:35:29 +0000 Subject: [PATCH] Doesn't grab mutex in __PHYSFS_setError() if PHYSFS_init() hasn't been called. --- physfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/physfs.c b/physfs.c index 4fb8db3c..961de8ad 100644 --- a/physfs.c +++ b/physfs.c @@ -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 */