chore: cherry-pick df77f100c3c2 from chromium #44975
Open
+130
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove GestureListenerManager as observer before destruction
GestureListenerManager adds itself as InputEventObserver but doesn't
remove itself from the observer list when getting destroyed, which
causes dangling raw pointer failures (use-after-free) if
GestureListenerManager gets destroyed before RenderWidgetHost and
dangling raw pointer checks are enabled.
Thus remove GestureListenerManager as observer when
GestureListenerManager is destructed.
Fixes regression from the following change:
https://chromium-review.googlesource.com/c/chromium/src/+/5887051
Change-Id: Ia24a0d4b80533e3a6406e7398351f37c682211fe
Bug: 378464985
Change-Id: Ia24a0d4b80533e3a6406e7398351f37c682211fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6012419
Reviewed-by: Bo Liu [email protected]
Commit-Queue: Olle Liljenzin [email protected]
Reviewed-by: Yaron Friedman [email protected]
Cr-Commit-Position: refs/heads/main@{#1386220}
Notes: Backported fix for 378464985.