Bug 1322107 - Scope local presshell variable in less error prone way. r=mccr8

--HG--
extra : rebase_source : 3ff847f0edde69facf963b5e82bad0510bbf756e
This commit is contained in:
Olli Pettay 2016-12-19 16:48:23 -05:00
parent b7bda6c6b1
commit 98b7134a01

View File

@ -4061,10 +4061,11 @@ PresShell::FlushPendingNotifications(mozilla::ChangesToFlush aFlush)
RefPtr<nsViewManager> viewManager = mViewManager;
bool didStyleFlush = false;
bool didLayoutFlush = false;
nsCOMPtr<nsIPresShell> kungFuDeathGrip;
if (isSafeToFlush && viewManager) {
// Processing pending notifications can kill us, and some callers only
// hold weak refs when calling FlushPendingNotifications(). :(
nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
kungFuDeathGrip = this;
if (mResizeEvent.IsPending()) {
FireResizeEvent();