Scope local presshell variable in less error-prone way.

This commit is contained in:
Pale Moon
2017-02-01 19:06:22 +01:00
parent 4b9c26504a
commit 64e683f6fb
+2 -1
View File
@@ -4234,10 +4234,11 @@ PresShell::FlushPendingNotifications(mozilla::ChangesToFlush aFlush)
nsRefPtr<nsViewManager> viewManagerDeathGrip = mViewManager;
bool didStyleFlush = false;
bool didLayoutFlush = false;
nsCOMPtr<nsIPresShell> kungFuDeathGrip;
if (isSafeToFlush && mViewManager) {
// 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();