Просмотр исходного кода

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

Ryan C. Gordon 24 лет назад
Родитель
Сommit
7ffd15fb42
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      physfs.c

+ 6 - 2
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 */