Avoid calling EndFrame() on deleted nsDisplayListBuilder
authorMiko Mynttinen <mikokm@gmail.com>
Thu, 14 Sep 2017 14:50:16 -0400
changeset 685637 c87a3cd41bedef3e3186e0c4a12c49827386af74
parent 685636 145dbc4727d3bb2d964765a1738ecdfac782a24a
child 685638 084f83687e37a34e8186ab2b7bbb6a20a7a0eb2f
push id86010
push userbmo:ethlin@mozilla.com
push dateWed, 25 Oct 2017 00:44:42 +0000
milestone57.0a1
Avoid calling EndFrame() on deleted nsDisplayListBuilder
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -4726,20 +4726,20 @@ nsLayoutUtils::PaintFrame(gfxContext* aR
     
     // Flush the list so we don't trigger the IsEmpty-on-destruction assertion
     if (!retainedBuilder) {
       list.DeleteAll(&builder);
       builder.EndFrame();
       delete listPtr;
       delete builderPtr;
     } else {
+      builder.EndFrame();
       if (builder.ShouldRecycle()) {
         aFrame->DeleteProperty(RetainedDisplayListBuilder::Cached());
       }
-      builder.EndFrame();
     }
   }
   return NS_OK;
 }
 
 /**
  * Uses a binary search for find where the cursor falls in the line of text
  * It also keeps track of the part of the string that has already been measured