]> git.sesse.net Git - stockfish/blobdiff - src/syzygy/tbprobe.cpp
Only close file if already open
[stockfish] / src / syzygy / tbprobe.cpp
index b7ba32407456f810b0354c4bc920d8c5c839fdfb..cc5e2852a09106d2c4b2a051cc5be6f61710d378 100644 (file)
@@ -199,13 +199,10 @@ public:
         }
     }
 
-    // Memory map the file and check it. File should be already open and will be
-    // closed after mapping.
+    // Memory map the file and check it.
     uint8_t* map(void** baseAddress, uint64_t* mapping, TBType type) {
-
-        assert(is_open());
-
-        close(); // Need to re-open to get native file descriptor
+        if (is_open())
+            close(); // Need to re-open to get native file descriptor
 
 #ifndef _WIN32
         struct stat statbuf;