]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix description in lily/include/smobs.hh
authorDavid Kastrup <dak@gnu.org>
Sat, 30 Jun 2012 13:06:44 +0000 (15:06 +0200)
committerDavid Kastrup <dak@gnu.org>
Sat, 30 Jun 2012 13:06:44 +0000 (15:06 +0200)
lily/include/smobs.hh

index cd28a29c3f0af531de7cb954f65e538fb1c80b02..fb4fa530ee3fd6ef93090a6d50fa4cb3da27315f 100644 (file)
@@ -46,7 +46,7 @@
 
   The constructor for a complex smob should have 3 steps:
 
-  * initialize all SCM members to a non-immediate value (like SCM_EOL)
+  * initialize all SCM members to aimmediate value (like SCM_EOL)
 
   * call smobify_self ()
 
 
   Complex_smob *p = new Complex_smob;
   list = scm_cons (p->self_scm (), list);
-  scm_gc_unprotect_object (p->self_scm ());
+  p->unprotect ();
+
+  Since unprotect returns the SCM object itself, this particular case
+  can be written as
+
+  Complex_smob *p = new Complex_smob;
+  list = scm_cons (p->unprotect (), list);
 
   Complex smobs are made with DECLARE_SMOBS (Classname) in the class
   declaration.