Added another try-catch to the native lib version check in case rights settings get weird (reported on MCF).

This commit is contained in:
Florian Nücke 2014-07-02 19:13:53 +02:00
parent da264e3aca
commit ce4316e91d

View File

@ -103,6 +103,7 @@ object LuaStateFactory {
// If the file, already exists, make sure it's the same we need, if it's
// not disable use of the natives.
if (file.exists()) {
try {
val inCurrent = libraryUrl.openStream()
val inExisting = new FileInputStream(file)
var matching = true
@ -120,6 +121,11 @@ object LuaStateFactory {
while (inCurrentByte != -1 && inExistingByte != -1)
inCurrent.close()
inExisting.close()
}
catch {
case _: Throwable =>
matching = false
}
if (!matching) {
// Try to delete an old instance of the library, in case we have an update
// and deleteOnExit fails (which it regularly does on Windows it seems).