mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-31 02:39:22 +00:00
Fixed duplicated listeners when doing remove provisioning
This commit is contained in:
parent
037cd71814
commit
8c1889b181
1 changed files with 10 additions and 4 deletions
|
|
@ -163,6 +163,8 @@ class CoreContext
|
|||
// Wait for GlobalState.ON as some settings modification won't be saved
|
||||
// in RC file if Core isn't ON
|
||||
onCoreStarted()
|
||||
} else if (state == GlobalState.Shutdown) {
|
||||
onCoreStopped()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -500,6 +502,14 @@ class CoreContext
|
|||
Log.i("$TAG Started contacts, telecom & notifications managers")
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun onCoreStopped() {
|
||||
Log.w("$TAG Core is being shut down, notifying managers so they can remove their listeners and do some cleanup if needed")
|
||||
contactsManager.onCoreStopped(core)
|
||||
telecomManager.onCoreStopped(core)
|
||||
notificationsManager.onCoreStopped(core)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun destroyCore() {
|
||||
if (!::core.isInitialized) {
|
||||
|
|
@ -522,10 +532,6 @@ class CoreContext
|
|||
|
||||
core.stop()
|
||||
|
||||
contactsManager.onCoreStopped(core)
|
||||
telecomManager.onCoreStopped(core)
|
||||
notificationsManager.onCoreStopped(core)
|
||||
|
||||
// It's very unlikely the process will survive until the Core reaches GlobalStateOff sadly
|
||||
Log.w("$TAG Core has been shut down")
|
||||
exitProcess(0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue