mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-21 23:38:05 -04:00
Use getApplicationContext() instead of getContext() to prevent memory leaks.
Using whatever `Activity` as the `Context` used to construct the first content provider means that it will be help onto in memory until the application is GC'ed.
This commit is contained in:
@@ -86,7 +86,7 @@ public abstract class FDroidProvider extends ContentProvider {
|
||||
}
|
||||
|
||||
protected final synchronized SQLiteDatabase db() {
|
||||
return getOrCreateDb(getContext()).getWritableDatabase();
|
||||
return getOrCreateDb(getContext().getApplicationContext()).getWritableDatabase();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user