[EMAIL PROTECTED] writes:
> Fri, 14 May 2004 09:03:33 +0200, Han-Wen a dit : 
> 
>  > [EMAIL PROTECTED] writes:
>  >> +LY_DEFINE (ly_clone_parser, "ly:clone-parser",
>  >> +           1, 0, 0, 
>  >> +           (SCM parser_smob),
>  >> +           "Return a clone of PARSER_SMOB.")
>  >> +{
>  >> +  My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
>  >> +  My_lily_parser *clone = new My_lily_parser (*parser);
>  >> +  return clone->self_scm ();
>  >> +}
> 
>  > nitpick: you should do
> 
>  >   return scm_gc_unprotect_object (clone->self_scm ());
> 
> OK. I've seen several occurences of this pattern in the source code,
> but wasn't sure of what it meant, for I didn't find the definition of
> scm_gc_unprotect_object in the guile reference manual. Does it means
> that the object is made garbage-collectable? (for an unknown reason my

Yes. The protection is necessary because the C++ object is not
referenced as an SCM from the C++ stack.

> 
> nicolas
> 

-- 

 Han-Wen Nienhuys   |   [EMAIL PROTECTED]   |   http://www.xs4all.nl/~hanwen 



_______________________________________________
lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to