Bug 1559957 - reset Cairo data in WillShutdown before gfxPlatform destructor is called. r=jfkthame
authorLee Salzman <lsalzman@mozilla.com>
Tue, 25 Jun 2019 17:35:55 +0000
changeset 480058 0d9f920680e323ad178ac6546f8834b1e4ef1e37
parent 480057 d5b60a2a9cd9ebebe089503474ace5dd2c2eaf9a
child 480059 82f44a6420c57bd206a166477bf3ab1fe005bcab
push id36200
push useraiakab@mozilla.com
push dateTue, 25 Jun 2019 21:58:14 +0000
treeherdermozilla-central@b23bd78e4d94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1559957
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1559957 - reset Cairo data in WillShutdown before gfxPlatform destructor is called. r=jfkthame Differential Revision: https://phabricator.services.mozilla.com/D35820
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1325,19 +1325,17 @@ void gfxPlatform::ShutdownLayersIPC() {
 }
 
 void gfxPlatform::WillShutdown() {
   // Destoy these first in case they depend on backend-specific resources.
   // Otherwise, the backend's destructor would be called before the
   // base gfxPlatform destructor.
   mScreenReferenceSurface = nullptr;
   mScreenReferenceDrawTarget = nullptr;
-}
-
-gfxPlatform::~gfxPlatform() {
+
   // The cairo folks think we should only clean up in debug builds,
   // but we're generally in the habit of trying to shut down as
   // cleanly as possible even in production code, so call this
   // cairo_debug_* function unconditionally.
   //
   // because cairo can assert and thus crash on shutdown, don't do this in
   // release builds
 #ifdef NS_FREE_PERMANENT_DATA
@@ -1348,16 +1346,19 @@ gfxPlatform::~gfxPlatform() {
 #  endif
 
 #  if MOZ_TREE_CAIRO
   cairo_debug_reset_static_data();
 #  endif
 #endif
 }
 
+gfxPlatform::~gfxPlatform() {
+}
+
 /* static */
 already_AddRefed<DrawTarget> gfxPlatform::CreateDrawTargetForSurface(
     gfxASurface* aSurface, const IntSize& aSize) {
   SurfaceFormat format = aSurface->GetSurfaceFormat();
   RefPtr<DrawTarget> drawTarget = Factory::CreateDrawTargetForCairoSurface(
       aSurface->CairoSurface(), aSize, &format);
   if (!drawTarget) {
     gfxWarning() << "gfxPlatform::CreateDrawTargetForSurface failed in "