From 3212bc226604a8f97a309cfa27a9a01cff0a6ef4 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 1 Feb 2022 13:40:35 +0000 Subject: [PATCH] ensuring we use the application context for the datastore to avoid any local activity leaks --- .../main/java/im/vector/app/core/datastore/DataStoreProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/core/datastore/DataStoreProvider.kt b/vector/src/main/java/im/vector/app/core/datastore/DataStoreProvider.kt index 0cea36f53d..f5f76b48b3 100644 --- a/vector/src/main/java/im/vector/app/core/datastore/DataStoreProvider.kt +++ b/vector/src/main/java/im/vector/app/core/datastore/DataStoreProvider.kt @@ -40,7 +40,7 @@ private class MappedPreferenceDataStoreSingletonDelegate : ReadOnlyProperty dataStoreCache.getOrPut(key) { PreferenceDataStoreFactory.create { - context.preferencesDataStoreFile(key) + context.applicationContext.preferencesDataStoreFile(key) } } }