mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-09-30 16:16:30 -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:
1 parent
63d3006ba8
commit
f7bbf0e282
1 file changed
+1
-1
@@ -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