Bug 1348222 - Assign 'mScrollEvent' while 'ev' still has a non-null value. r=smaug

MozReview-Commit-ID: 3OsNlgHFEzM
This commit is contained in:
Mats Palmgren 2017-03-17 20:55:24 +01:00
parent 67d7b8af2a
commit 4ef842400f

View File

@ -6185,6 +6185,7 @@ Selection::PostScrollSelectionIntoViewEvent(
RefPtr<ScrollSelectionIntoViewEvent> ev =
new ScrollSelectionIntoViewEvent(this, aRegion, aVertical, aHorizontal,
aFlags);
mScrollEvent = ev;
nsresult rv;
nsIDocument* doc = GetParentObject();
if (doc) {
@ -6195,10 +6196,10 @@ Selection::PostScrollSelectionIntoViewEvent(
rv = NS_DispatchToCurrentThread(ev);
}
NS_ENSURE_SUCCESS(rv, rv);
mScrollEvent = ev;
return NS_OK;
if (NS_WARN_IF(NS_FAILED(rv))) {
mScrollEvent = nullptr; // no need to hold on to the event
}
return rv;
}
NS_IMETHODIMP