ensuring we use the application context for the datastore to avoid any local activity leaks

This commit is contained in:
Adam Brown 2022-02-01 13:40:35 +00:00
parent d77e18f810
commit 3212bc2266

View File

@ -40,7 +40,7 @@ private class MappedPreferenceDataStoreSingletonDelegate : ReadOnlyProperty<Cont
{ key -> { key ->
dataStoreCache.getOrPut(key) { dataStoreCache.getOrPut(key) {
PreferenceDataStoreFactory.create { PreferenceDataStoreFactory.create {
context.preferencesDataStoreFile(key) context.applicationContext.preferencesDataStoreFile(key)
} }
} }
} }