avoid closing db for background threads.

This commit is contained in:
tom79 2020-04-12 15:45:17 +02:00
parent 2cd77e3f6d
commit 7f3319f805
2 changed files with 1 additions and 3 deletions

View File

@ -1683,9 +1683,6 @@ public abstract class BaseMainActivity extends BaseActivity
if (mPageReferenceMap != null)
mPageReferenceMap = null;
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("isMainActivityRunning", false).apply();
if (Sqlite.db != null) {
Sqlite.db.close();
}
}
@Override

View File

@ -183,6 +183,7 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
type = RetrieveFeedsAsyncTask.Type.CHANNEL;
assert context != null;
SQLiteDatabase db = Sqlite.getInstance(context.getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
//instanceType should not be null only for Peertube accounts