]> git.donarmstrong.com Git - lilypond.git/commitdiff
(derived_mark): new method. Yes. We
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Aug 2005 10:46:35 +0000 (10:46 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Aug 2005 10:46:35 +0000 (10:46 +0000)
have to protect even those unlikely to be corrupted data members.

ChangeLog
THANKS
lily/auto-beam-engraver.cc
lily/clef-engraver.cc
lily/grob-array.cc
lily/hara-kiri-engraver.cc
lily/ly-module.cc
lily/stanza-number-engraver.cc
lily/time-signature-engraver.cc
lily/volta-engraver.cc

index 322e681fef53c166577deef870439f794fb54cf8..e62c22992d3ef28cd34f3ef24ed1d2b1987f839d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-04  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/auto-beam-engraver.cc (derived_mark): new method. Yes. We
+       have to protect even those unlikely to be corrupted data members.  
+
 2005-08-04  Graham Percival  <gperlist@shaw.ca>
 
        * ly/bagpipe.ly: new file.
diff --git a/THANKS b/THANKS
index e6705819274f0e6cc0fad58361cfa22efe5d77b1..62452ed9032ad17fd83e4096c476672ed18c49f3 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -31,7 +31,7 @@ BUG HUNTERS/SUGGESTIONS
 
 Erlend Aasland
 Bob Broadus
-
+Donald Axel
 
 
 Release 2.6
index 8cff65e02ce0539e16b917516fd08d83c6611066..823f2880817d0bf7025864019f56f8780170d5d8 100644 (file)
@@ -31,7 +31,8 @@ protected:
   void process_music ();
   virtual bool try_music (Music *);
   virtual void finalize ();
-
+  virtual void derived_mark () const;
+  
   DECLARE_ACKNOWLEDGER (rest);
   DECLARE_ACKNOWLEDGER (beam);
   DECLARE_ACKNOWLEDGER (bar_line);
@@ -72,7 +73,7 @@ private:
 
   // We act as if beam were created, and start a grouping anyway.
   Beaming_info_list *grouping_;
-  SCM beam_settings_;          // ugh. should protect ? 
+  SCM beam_settings_;
 
   Beaming_info_list *finished_grouping_;
 
@@ -80,6 +81,13 @@ private:
 };
 
 
+void
+Auto_beam_engraver::derived_mark () const
+{
+  scm_gc_mark (beam_settings_);
+}
+
+
 void
 Auto_beam_engraver::check_bar_property ()
 {
@@ -181,7 +189,13 @@ Auto_beam_engraver::create_beam ()
     if (Stem::get_beam ((*stems_)[i]))
       return 0;
 
-  Spanner *beam = new Spanner (beam_settings_, context ()->get_grob_key ("Beam"));
+  /*
+    Can't use make_spanner_from_properties() because we have to use
+    beam_settings_.
+   */
+  Spanner *beam = new Spanner (beam_settings_,
+                              context ()->get_grob_key ("Beam"));
+
   for (int i = 0; i < stems_->size (); i++)
     {
       Beam::add_stem (beam, (*stems_)[i]);
index 629ffee80c182c901cc6c14a50717a4cc2a1d5de..04603ba7b9cabb1fe0c23cb45eeffdd09d4bedbc 100644 (file)
@@ -30,6 +30,8 @@ protected:
   void stop_translation_timestep ();
   void process_music ();
   DECLARE_ACKNOWLEDGER (bar_line);
+
+  virtual void derived_mark () const;
 private:
   Item *clef_;
   Item *octavate_;
@@ -42,6 +44,14 @@ private:
   void inspect_clef_properties ();
 };
 
+void
+Clef_engraver::derived_mark () const
+{
+  scm_gc_mark (prev_octavation_);
+  scm_gc_mark (prev_cpos_);
+  scm_gc_mark (prev_glyph_);
+}
+
 Clef_engraver::Clef_engraver ()
 {
   clef_ = 0;
index fa8d4cd65c797e7604d98715d2bb3aa555f8ac38..2aa4ee7991216997da6db9744c05989febc29e57 100644 (file)
@@ -50,7 +50,7 @@ Grob_array::mark_smob (SCM s)
   (void) s;
   
 #if 0
-  // see System::derived_mark()
+  // see System::derived_mark () const
   Grob_array *ga = unsmob_grob_array (s); 
   for (int i = 0; i < ga->grobs_.size(); i++)
     scm_gc_mark (ga->grobs_[i]->self_scm ());
index 2460e0e7b770ff7d4aaee94d0bf56d65d19a751b..3441b9db080a8ab6bcb9cb74a9f805ff234c94bc 100644 (file)
@@ -21,12 +21,18 @@ protected:
   DECLARE_ACKNOWLEDGER (grob);
   virtual void add_element (Grob *e);
   void start_translation_timestep ();
-
+  virtual void derived_mark () const;
   SCM interesting_;
 public:
   TRANSLATOR_DECLARATIONS (Hara_kiri_engraver);
 };
 
+void
+Hara_kiri_engraver::derived_mark () const
+{
+  scm_gc_mark (interesting_);
+}
+  
 void
 Hara_kiri_engraver::start_translation_timestep ()
 {
index ba99e64f7470fe15352577fdb0b8baea60994ced..2dcdb0ffa2e93f1b8bd8c8c1cc86d9f42b8e53bd 100644 (file)
@@ -162,9 +162,10 @@ make_stand_in_procs_weak ()
   SCM old_tab = scm_stand_in_procs;
   SCM new_tab = scm_make_weak_key_hash_table (scm_from_int (257));
   
-  new_tab = scm_internal_hash_fold ((Hash_closure_function) & redefine_keyval,
+  new_tab = scm_internal_hash_fold ((Hash_closure_function) &redefine_keyval,
                                    NULL,
-                                   new_tab, old_tab);
+                                   new_tab,
+                                   old_tab);
 
   scm_stand_in_procs = new_tab;
 }
index 8dd9c16f6c4c1884717fdcfe0043090e953a5485..866336e224d2e9060dbc521d46379a73e00f8c7e 100644 (file)
@@ -13,19 +13,21 @@ class Stanza_number_engraver : public Engraver
 {
   Item *text_;
 
-  /*
-    This is naughty, since last_stanza_ may be GCd from under us.  But
-    since we don't look at the contents, we are/should be (knock on
-    wood) OK.
-  */
   SCM last_stanza_;
 public:
   TRANSLATOR_DECLARATIONS (Stanza_number_engraver);
   void process_music ();
+  virtual void derived_mark () const;
   void stop_translation_timestep ();
   DECLARE_ACKNOWLEDGER (lyric_syllable);
 };
 
+void
+Stanza_number_engraver::derived_mark () const
+{
+  scm_gc_mark (last_stanza_);
+}
+
 /*
   TODO: should make engraver that collects all the stanzas on a higher
   level, and then groups them to the side. Stanza numbers should be
index 1815a865e83d51847721c38563fddc64b365d0c3..3ebb80672a48b0b130ecf4bb9469a92fe45a6af7 100644 (file)
@@ -20,12 +20,21 @@ class Time_signature_engraver : public Engraver
   SCM last_time_fraction_;
 
 protected:
+  virtual void derived_mark () const;
   void stop_translation_timestep ();
   void process_music ();
 public:
   TRANSLATOR_DECLARATIONS (Time_signature_engraver);
 };
 
+
+void
+Time_signature_engraver::derived_mark () const
+{
+  scm_gc_mark (last_time_fraction_);
+}
+
+
 Time_signature_engraver::Time_signature_engraver ()
 {
   time_signature_ = 0;
index 5d8b0107df85e5a4a3093998ef334fcbd0b5ae44..0189f1521e0b3167d3490d68f12fc2a298f9f34b 100644 (file)
@@ -32,10 +32,10 @@ protected:
   DECLARE_ACKNOWLEDGER (bar_line);
   
   virtual void finalize ();
-
+  virtual void derived_mark () const;
   void stop_translation_timestep ();
   void process_music ();
-
+  
   Moment started_mom_;
   Spanner *volta_span_;
   Spanner *end_volta_span_;
@@ -45,6 +45,13 @@ protected:
   bool staff_eligible ();
 };
 
+void
+Volta_engraver::derived_mark () const
+{
+  scm_gc_mark (staff_);
+  scm_gc_mark (start_string_);
+}
+
 Volta_engraver::Volta_engraver ()
 {
   staff_ = SCM_EOL;