From d8f457a8016d7f815d545aa675c4f050cefa5335 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 28 Dec 2012 11:53:05 -0800 Subject: [PATCH] do not allow s to be garbage collected in Font_metric::mark_smob before the function is done with it. --- lily/font-metric.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 6990afe..8ca88ef 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -106,6 +106,9 @@ Font_metric::mark_smob (SCM s) { Font_metric *m = (Font_metric *) SCM_CELL_WORD_1 (s); m->derived_mark (); + // we must do this to avoid s being optimized out and garbage + // collected; leading to a segfault above. + scm_remember_upto_here_1(s); return m->description_; } -- 1.7.10.4