Bug 1395361: Avoid using mCoalescedMouseEventFlusher after it's destroyed. r=smaug.

MozReview-Commit-ID: Fbu3zfERY0P
This commit is contained in:
Stone Shih 2017-08-31 12:00:08 +08:00
Родитель 2c86b9676b
Коммит c803058e5f
1 изменённых файлов: 5 добавлений и 5 удалений

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

@ -1608,9 +1608,10 @@ TabChild::MaybeDispatchCoalescedMouseMoveEvents()
RecvRealMouseButtonEvent(*event,
mCoalescedWheelData.GetScrollableLayerGuid(),
mCoalescedWheelData.GetInputBlockId());
MOZ_ASSERT(mCoalescedMouseEventFlusher);
mCoalescedMouseData.Reset();
mCoalescedMouseEventFlusher->RemoveObserver();
if (mCoalescedMouseEventFlusher) {
mCoalescedMouseData.Reset();
mCoalescedMouseEventFlusher->RemoveObserver();
}
}
mozilla::ipc::IPCResult
@ -1618,8 +1619,7 @@ TabChild::RecvRealMouseMoveEvent(const WidgetMouseEvent& aEvent,
const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId)
{
if (mCoalesceMouseMoveEvents) {
MOZ_ASSERT(mCoalescedMouseEventFlusher);
if (mCoalesceMouseMoveEvents && mCoalescedMouseEventFlusher) {
if (mCoalescedMouseData.CanCoalesce(aEvent, aGuid, aInputBlockId)) {
mCoalescedMouseData.Coalesce(aEvent, aGuid, aInputBlockId);
mCoalescedMouseEventFlusher->StartObserver();