]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music.cc
release: 1.4.15
[lilypond.git] / lily / music.cc
index 2becb7f0ec7b3c0370fd97c703bf82d64c390d5d..c57322b8d9f3588584b3e583914853f98c8c002d 100644 (file)
@@ -41,11 +41,15 @@ Music::Music ()
 Music::Music (Music const &m)
 {
   immutable_property_alist_ = m.immutable_property_alist_;
-  SCM c =ly_deep_mus_copy (m.mutable_property_alist_);
-  mutable_property_alist_ = c;
+  mutable_property_alist_ = SCM_EOL;
 
+  /*
+    First we smobify_self, then we copy over the stuff.  If we don't,
+    stack vars that hold the copy might be optimized away, meaning
+    that they won't be protected from GC.
+   */
   smobify_self ();
-
+  mutable_property_alist_ = ly_deep_mus_copy (m.mutable_property_alist_);
   set_spot (*m.origin ());
 }
 
@@ -173,6 +177,8 @@ Music::set_mus_property (const char* k, SCM v)
   set_mus_property (s, v);
 }
 
+void paranoia_check (Music*);
+
 void
 Music::set_immutable_mus_property (const char*k, SCM v)
 {
@@ -307,3 +313,4 @@ init_functions ()
 }
 ADD_SCM_INIT_FUNC (musicscm,init_functions);
 ADD_MUSIC(Music);
+