Bug 1570556 - Remove call to pango_fc_font_map_shutdown, which was moved out of public headers in Pango 1.44. r=dbaron
authorJonathan Kew <jkew@mozilla.com>
Thu, 15 Aug 2019 20:10:41 +0000
changeset 488468 c670f40348ee7794f031ef7f84019592d56154cd
parent 488467 47f90b1619aebaa588c039fcde7b6ca46debeb25
child 488469 f96d420517972051aeb08355243e6d7b081c4b94
push id92765
push userjkew@mozilla.com
push dateFri, 16 Aug 2019 09:09:36 +0000
treeherderautoland@c670f40348ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1570556
milestone70.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 1570556 - Remove call to pango_fc_font_map_shutdown, which was moved out of public headers in Pango 1.44. r=dbaron Differential Revision: https://phabricator.services.mozilla.com/D42127
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -2722,51 +2722,26 @@ static void MOZ_gdk_display_close(GdkDis
     g_free(theme_name);
   }
 
 #    ifdef MOZ_WIDGET_GTK
   // A workaround for https://bugzilla.gnome.org/show_bug.cgi?id=703257
   if (gtk_check_version(3, 9, 8) != NULL) skip_display_close = true;
 #    endif
 
-  // Get a (new) Pango context that holds a reference to the fontmap that
-  // GTK has been using.  gdk_pango_context_get() must be called while GTK
-  // has a default display.
-  PangoContext* pangoContext = gdk_pango_context_get();
-
   bool buggyCairoShutdown = cairo_version() < CAIRO_VERSION_ENCODE(1, 4, 0);
 
   if (!buggyCairoShutdown) {
     // We should shut down GDK before we shut down libraries it depends on
     // like Pango and cairo. But if cairo shutdown is buggy, we should
     // shut down cairo first otherwise it may crash because of dangling
     // references to Display objects (see bug 469831).
     if (!skip_display_close) gdk_display_close(display);
   }
 
-  // Clean up PangoCairo's default fontmap.
-  // This pango_fc_font_map_shutdown call (and the associated code to
-  // get the font map) really shouldn't be needed anymore, except that
-  // it's needed to avoid having cairo_debug_reset_static_data fatally
-  // assert if we've leaked other things that hold on to the fontmap,
-  // which is something that currently happens in mochitest-plugins.
-  // Even if it didn't happen in mochitest-plugins, we probably want to
-  // avoid the crash-on-leak problem since it makes it harder to use
-  // many of our leak tools to debug leaks.
-
-  // This doesn't take a reference.
-  PangoFontMap* fontmap = pango_context_get_font_map(pangoContext);
-  // Do some shutdown of the fontmap, which releases the fonts, clearing a
-  // bunch of circular references from the fontmap through the fonts back to
-  // itself.  The shutdown that this does is much less than what's done by
-  // the fontmap's finalize, though.
-  if (PANGO_IS_FC_FONT_MAP(fontmap))
-    pango_fc_font_map_shutdown(PANGO_FC_FONT_MAP(fontmap));
-  g_object_unref(pangoContext);
-
   // Tell PangoCairo to release its default fontmap.
   pango_cairo_font_map_set_default(nullptr);
 
   // cairo_debug_reset_static_data() is prototyped through cairo.h included
   // by gtk.h.
 #    ifdef cairo_debug_reset_static_data
 #      error \
           "Looks like we're including Mozilla's cairo instead of system cairo"