Doesn't grab mutex in __PHYSFS_setError() if PHYSFS_init() hasn't been called.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 08 Apr 2002 13:35:29 +0000
changeset 193 830c165052a5
parent 192 8777e3f08724
child 194 09c353d30cd4
Doesn't grab mutex in __PHYSFS_setError() if PHYSFS_init() hasn't been called.
physfs.c
--- a/physfs.c	Mon Apr 08 13:34:58 2002 +0000
+++ b/physfs.c	Mon Apr 08 13:35:29 2002 +0000
@@ -107,7 +107,9 @@
     ErrMsg *i;
     PHYSFS_uint64 tid;
 
-    __PHYSFS_platformGrabMutex(errorLock);
+    if (initialized)
+        __PHYSFS_platformGrabMutex(errorLock);
+
     if (errorMessages != NULL)
     {
         tid = __PHYSFS_platformGetThreadID();
@@ -121,7 +123,9 @@
             } /* if */
         } /* for */
     } /* if */
-    __PHYSFS_platformReleaseMutex(errorLock);
+
+    if (initialized)
+        __PHYSFS_platformReleaseMutex(errorLock);
 
     return(NULL);   /* no error available. */
 } /* findErrorForCurrentThread */