physfs.c
changeset 751 74dc021744de
parent 746 88780f7156d3
child 754 e7cd7411eadf
--- a/physfs.c	Tue Sep 06 06:28:35 2005 +0000
+++ b/physfs.c	Fri Sep 09 14:07:43 2005 +0000
@@ -777,7 +777,8 @@
     if (!externalAllocator)
         setDefaultAllocator();
 
-    BAIL_IF_MACRO(!allocator.Init(), NULL, 0);
+    if (allocator.Init != NULL)
+        BAIL_IF_MACRO(!allocator.Init(), NULL, 0);
 
     BAIL_IF_MACRO(!__PHYSFS_platformInit(), NULL, 0);
 
@@ -889,7 +890,8 @@
     __PHYSFS_platformDestroyMutex(errorLock);
     __PHYSFS_platformDestroyMutex(stateLock);
 
-    allocator.Deinit();
+    if (allocator.Deinit != NULL)
+        allocator.Deinit();
 
     errorLock = stateLock = NULL;
     return(1);
@@ -2047,7 +2049,7 @@
 } /* PHYSFS_flush */
 
 
-int PHYSFS_setAllocator(PHYSFS_Allocator *a)
+int PHYSFS_setAllocator(const PHYSFS_Allocator *a)
 {
     BAIL_IF_MACRO(initialized, ERR_IS_INITIALIZED, 0);
     externalAllocator = (a != NULL);