Bug 1322107 - Scope local presshell variable in less error prone way. r=mccr8
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user