[libbluray-devel] Make sure flag is cleared even if there is an exception

hpi1 git at videolan.org
Sat Nov 21 21:54:31 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Nov 21 22:42:06 2015 +0200| [829811b9a39046ea9272c59a85e6df7651cae64b] | committer: hpi1

Make sure flag is cleared even if there is an exception

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=829811b9a39046ea9272c59a85e6df7651cae64b
---

 src/libbluray/bdj/java/org/videolan/VFSCache.java |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/VFSCache.java b/src/libbluray/bdj/java/org/videolan/VFSCache.java
index b8e68da..97133a7 100644
--- a/src/libbluray/bdj/java/org/videolan/VFSCache.java
+++ b/src/libbluray/bdj/java/org/videolan/VFSCache.java
@@ -277,9 +277,12 @@ class VFSCache {
             return;
         }
 
-        inAccessFile = true;
-        accessFileImp(absPath);
-        inAccessFile = false;
+        try {
+            inAccessFile = true;
+            accessFileImp(absPath);
+        } finally {
+            inAccessFile = false;
+        }
     }
 
     private void accessFileImp(String absPath) {



More information about the libbluray-devel mailing list