From d39d26f842c7b997209986c034567fee97c38c84 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 3 Jun 2015 11:18:18 +0200 Subject: [PATCH] Close in finally block --- src/com/owncloud/android/lib/common/utils/Log_OC.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/owncloud/android/lib/common/utils/Log_OC.java b/src/com/owncloud/android/lib/common/utils/Log_OC.java index c99c5e59..2bef4fc9 100644 --- a/src/com/owncloud/android/lib/common/utils/Log_OC.java +++ b/src/com/owncloud/android/lib/common/utils/Log_OC.java @@ -167,10 +167,15 @@ public class Log_OC { mBuf.newLine(); mBuf.write(text); mBuf.newLine(); - mBuf.close(); } catch (IOException e) { e.printStackTrace(); - } + } finally { + try { + mBuf.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } // Check if current log file size is bigger than the max file size defined if (mLogFile.length() > MAX_FILE_SIZE) {