1
0
mirror of https://github.com/etesync/android synced 2025-01-23 22:21:23 +00:00

Fix DB resource leak.

It doesn't affect anything in a noticeable way, but still, obviously,
   worth fixing.
This commit is contained in:
Tom Hacohen 2017-11-29 09:59:11 +00:00
parent af04b2fa45
commit c2521bf556

View File

@ -134,8 +134,8 @@ public class App extends Application {
} }
private void loadLanguage() { private void loadLanguage() {
String lang = new Settings(new ServiceDB.OpenHelper(this). @Cleanup ServiceDB.OpenHelper serviceDB = new ServiceDB.OpenHelper(this);
getReadableDatabase()).getString(App.FORCE_LANGUAGE, null); String lang = new Settings(serviceDB.getReadableDatabase()).getString(App.FORCE_LANGUAGE, null);
if (lang != null && !lang.equals(DEFAULT_LANGUAGE)) { if (lang != null && !lang.equals(DEFAULT_LANGUAGE)) {
LanguageUtils.setLanguage(this, lang); LanguageUtils.setLanguage(this, lang);
} }