From 13fc2437e2aaa9ec5a65926dcb54d233a4797f45 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Fri, 15 Jul 2011 09:56:28 +1000 Subject: [PATCH] Fix a segfault caused by improper initialization of SCM. --- lily/pango-font.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lily/pango-font.cc b/lily/pango-font.cc index a4fea75109..26f2e53fb4 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -47,6 +47,10 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap, PangoFontDescription const *description, Real output_scale) { + // This line looks stupid, but if we don't initialize physical_font_tab_ before + // we allocate memory in scm_c_make_hash_table, then that could trigger a garbage + // collection. + physical_font_tab_ = SCM_EOL; physical_font_tab_ = scm_c_make_hash_table (11); PangoDirection pango_dir = PANGO_DIRECTION_LTR; context_ = pango_context_new (); -- 2.39.2