Bug 1739663 - Avoid a debug assertion on shutdown in InputQueue::Clear(). r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D130521
This commit is contained in:
Botond Ballo 2021-11-07 03:04:14 +00:00
Родитель 8e86ac27ee
Коммит dac9173b80
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -1021,7 +1021,14 @@ void InputQueue::UpdateActiveApzc(
}
void InputQueue::Clear() {
APZThreadUtils::AssertOnControllerThread();
// On Android, where the controller thread is the Android UI thread,
// it's possible for this to be called after the main thread has
// already run the shutdown task that clears the state used to
// implement APZThreadUtils::AssertOnControllerThread().
// In such cases, we still want to perform the cleanup.
if (APZThreadUtils::IsControllerThreadAlive()) {
APZThreadUtils::AssertOnControllerThread();
}
mQueuedInputs.Clear();
mActiveTouchBlock = nullptr;