Skip to content

Commit

Permalink
Reset all global state when destroying the Glean handle
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
badboy committed Jul 22, 2020
1 parent 7b4bcf7 commit 41cd294
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit 41cd294

Please sign in to comment.