Fixup a resource leak warning.

This commit is contained in:
LexManos 2013-01-28 17:06:45 -08:00
parent 89e695cee9
commit fbe86287b4

View file

@ -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){}
}
}
}