Reset all global state when destroying the Glean handle

After we destroy the Glean handle we should be conceptually in a clean
state, just as if the app is just starting and loading Glean.

And for Glean that means tasks should get queued up.
Some tests explicitly toggle this already, but resetting it here does
not seem to affect them.
This commit is contained in:
Jan-Erik Rediger 2020-07-21 14:54:59 +02:00
Родитель 47e78650d2
Коммит 2971286519
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -776,8 +776,12 @@ open class GleanInternalAPI internal constructor () {
}
LibGleanFFI.INSTANCE.glean_destroy_glean()
initialized = false
// Reset all state.
@Suppress("EXPERIMENTAL_API_USAGE")
Dispatchers.API.setTaskQueueing(true)
initFinished = false
initialized = false
}
/**