From: David Kastrup Date: Sat, 30 Jun 2012 13:06:44 +0000 (+0200) Subject: Fix description in lily/include/smobs.hh X-Git-Tag: release/2.15.41-1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=43fe858eb18418ae1d8867786ad873b7a4e2ae8a;p=lilypond.git Fix description in lily/include/smobs.hh --- diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index cd28a29c3f..fb4fa530ee 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -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 an immediate value (like SCM_EOL) * call smobify_self () @@ -67,7 +67,13 @@ 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.