diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/AlarmUtils.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/AlarmUtils.java index 5f1cb6733..045ce21f5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/AlarmUtils.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/AlarmUtils.java @@ -88,8 +88,7 @@ public class AlarmUtils { Set stringAlarms = prefs.getStringSet(MiBandConst.PREF_MIBAND_ALARMS, new HashSet()); List alarms = new ArrayList<>(stringAlarms.size()); - try { - DBHandler db = GBApplication.acquireDB(); + try (DBHandler db = GBApplication.acquireDB()) { DaoSession daoSession = db.getDaoSession(); User user = DBHelper.getUser(daoSession); Device device = DBHelper.getDevice(gbDevice, daoSession);