]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix a segfault caused by improper initialization of SCM.
authorJoe Neeman <joeneeman@gmail.com>
Thu, 14 Jul 2011 23:56:28 +0000 (09:56 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Fri, 15 Jul 2011 08:38:28 +0000 (18:38 +1000)
lily/pango-font.cc

index a4fea75109bcb15141db97da016cd30d291375a2..26f2e53fb4b5fce47b0294c5626cd3f9018cb733 100644 (file)
@@ -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 ();