diff options
Diffstat (limited to 'src/java/org/anarres/cpp/CppReader.java')
-rw-r--r-- | src/java/org/anarres/cpp/CppReader.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/java/org/anarres/cpp/CppReader.java b/src/java/org/anarres/cpp/CppReader.java index a429fd4..fbe3545 100644 --- a/src/java/org/anarres/cpp/CppReader.java +++ b/src/java/org/anarres/cpp/CppReader.java @@ -110,6 +110,10 @@ public class CppReader extends Reader { return true; } catch (LexerException e) { + /* Never happens. + if (e.getCause() instanceof IOException) + throw (IOException)e.getCause(); + */ IOException ie = new IOException(String.valueOf(e)); ie.initCause(e); throw ie; @@ -139,7 +143,10 @@ public class CppReader extends Reader { public void close() throws IOException { - cpp = null; + if (cpp != null) { + cpp.close(); + cpp = null; + } token = null; } |