Commit 3dd9ad71 authored by Siye Liu's avatar Siye Liu Committed by Commit Bot

Add null check for |event_handler_| in DirectManipulationHelper dtor.

Root cause is that if |DirectManipulationHelper::Initialize| returns
false, then DirectManipulationHelper hasn't been properly initialized,
and it's member |event_handler_| may still be nullptr. In destructor
of DirectManipulationHelper, |DirectManipulationHelper::Destroy| is
called which references |event_handler_| without a null check result in
AV. Fix is to add null check before referencing |event_handler_|.

Bug: 1001325
Change-Id: I815583413cb3e4c545568ea4ccba3b29366dedce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857546Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Siye Liu <siliu@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#705715}
parent c6b47723
...@@ -268,6 +268,8 @@ void DirectManipulationHelper::Destroy() { ...@@ -268,6 +268,8 @@ void DirectManipulationHelper::Destroy() {
if (has_animation_observer_) if (has_animation_observer_)
RemoveAnimationObserver(); RemoveAnimationObserver();
compositor_ = nullptr; compositor_ = nullptr;
if (event_handler_)
event_handler_->SetDirectManipulationHelper(nullptr); event_handler_->SetDirectManipulationHelper(nullptr);
HRESULT hr; HRESULT hr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment