mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed race condition issue on avatarsMap + listener removed by mistake
This commit is contained in:
parent
b113e2b729
commit
5f5885cb18
3 changed files with 10 additions and 4 deletions
|
|
@ -127,10 +127,10 @@ class ContactsManager @UiThread constructor(context: Context) {
|
|||
fun onNativeContactsLoaded() {
|
||||
nativeContactsLoaded = true
|
||||
|
||||
avatarsMap.values.forEach(ContactAvatarModel::destroy)
|
||||
avatarsMap.clear()
|
||||
|
||||
coreContext.postOnCoreThread {
|
||||
avatarsMap.values.forEach(ContactAvatarModel::destroy)
|
||||
avatarsMap.clear()
|
||||
|
||||
notifyContactsListChanged()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,9 @@ class DrawerMenuFragment : GenericFragment() {
|
|||
|
||||
viewModel.defaultAccountChangedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { identity ->
|
||||
Log.w("$TAG Default account has changed, now is [$identity], closing side menu in 500ms")
|
||||
Log.w(
|
||||
"$TAG Default account has changed, now is [$identity], closing side menu in 500ms"
|
||||
)
|
||||
sharedViewModel.defaultAccountChangedEvent.value = Event(true)
|
||||
|
||||
lifecycleScope.launch {
|
||||
|
|
|
|||
|
|
@ -121,6 +121,10 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
|||
init {
|
||||
searchBarVisible.value = false
|
||||
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.addListener(coreListener)
|
||||
}
|
||||
|
||||
update()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue