Fixup a resource leak warning.
This commit is contained in:
parent
89e695cee9
commit
fbe86287b4
1 changed files with 9 additions and 1 deletions
|
@ -440,6 +440,7 @@ public class Configuration
|
|||
}
|
||||
|
||||
BufferedReader buffer = null;
|
||||
UnicodeInputStreamReader input = null;
|
||||
try
|
||||
{
|
||||
if (file.getParentFile() != null)
|
||||
|
@ -454,7 +455,7 @@ public class Configuration
|
|||
|
||||
if (file.canRead())
|
||||
{
|
||||
UnicodeInputStreamReader input = new UnicodeInputStreamReader(new FileInputStream(file), defaultEncoding);
|
||||
input = new UnicodeInputStreamReader(new FileInputStream(file), defaultEncoding);
|
||||
defaultEncoding = input.getEncoding();
|
||||
buffer = new BufferedReader(input);
|
||||
|
||||
|
@ -638,6 +639,13 @@ public class Configuration
|
|||
buffer.close();
|
||||
} catch (IOException e){}
|
||||
}
|
||||
if (input != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
input.close();
|
||||
} catch (IOException e){}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue