The attached patch fixes a segfault/heap corruption that I was having,
but I'm not really sure why because I don't fully understand how the
guile garbage collection works.

Valgrind was complaining about reads/writes to unallocated memory from
line 57 of tuplet-number.cc. The memory had been freed in a garbage
collection sweep.
Index: lily/tuplet-number.cc
===================================================================
RCS file: /sources/lilypond/lilypond/lily/tuplet-number.cc,v
retrieving revision 1.4
diff -u -r1.4 tuplet-number.cc
--- lily/tuplet-number.cc	20 Mar 2006 11:47:13 -0000	1.4
+++ lily/tuplet-number.cc	5 Jun 2006 21:15:58 -0000
@@ -44,16 +44,16 @@
       return SCM_EOL;
     }
   
-  Stencil *stc = unsmob_stencil (Text_interface::print (smob));
-
-  stc->align_to (X_AXIS, CENTER);
-  stc->align_to (Y_AXIS, CENTER);
-
   SCM cpoints =  tuplet->get_property ("control-points");
   Drul_array<Offset> points;
   points[LEFT] = ly_scm2offset (scm_car (cpoints));
   points[RIGHT] = ly_scm2offset (scm_cadr (cpoints));
 
+  Stencil *stc = unsmob_stencil (Text_interface::print (smob));
+
+  stc->align_to (X_AXIS, CENTER);
+  stc->align_to (Y_AXIS, CENTER);
+
   stc->translate ((points[RIGHT] + points[LEFT]) / 2);
   
   return stc->smobbed_copy ();
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to