From 3ddd06679f1e666716391450adaa687db33332c7 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 5 Oct 2020 08:29:44 +0530 Subject: Resolve lock contention from lazy delegates (#1135) --- app/src/main/java/com/zeapo/pwdstore/git/config/GitSettings.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git/config') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/config/GitSettings.kt b/app/src/main/java/com/zeapo/pwdstore/git/config/GitSettings.kt index e43deaf4..f928590d 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/config/GitSettings.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/config/GitSettings.kt @@ -52,8 +52,8 @@ object GitSettings { private const val DEFAULT_BRANCH = "master" - private val settings by lazy { Application.instance.sharedPrefs } - private val encryptedSettings by lazy { Application.instance.getEncryptedGitPrefs() } + private val settings by lazy(LazyThreadSafetyMode.PUBLICATION) { Application.instance.sharedPrefs } + private val encryptedSettings by lazy(LazyThreadSafetyMode.PUBLICATION) { Application.instance.getEncryptedGitPrefs() } var authMode get() = AuthMode.fromString(settings.getString(PreferenceKeys.GIT_REMOTE_AUTH)) -- cgit v1.2.3