lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoid Scheme-computed Skyline_pair values to get collected before us


From: Keith OHara
Subject: Re: Avoid Scheme-computed Skyline_pair values to get collected before use (issue 12708048)
Date: Sun, 11 Aug 2013 13:41:21 -0700
User-agent: Opera Mail/12.16 (Win32)

On Sun, 11 Aug 2013 12:46:04 -0700, <address@hidden> wrote:

https://codereview.appspot.com/12708048/diff/1/lily/side-position-interface.cc
File lily/side-position-interface.cc (left):

https://codereview.appspot.com/12708048/diff/1/lily/side-position-interface.cc#oldcode216
lily/side-position-interface.cc:216: Skyline my_dim;

On 2013/08/11 19:30:46, Keith wrote:
I am merely curious whether get_*_property() creates a temporary copy
 of the Scheme object.

However, get_property can call callbacks, and then
the returned value is up for collection as soon as no SCM remains
referring to the returned value.


That's it.  The property in question is 'vertical-skylines' and it is generated 
by a callback.  From the stacktrace we can determine that get_*_property() was 
called with pure==true to generate the object that is pointed to by the copy of 
'skyp' that is associated with the crash.

So get_*_property() used internal_get_pure_property() which returns the 
computed skylines as a SCM object /without/ storing it in the 
'vertical-skylines' property (because it wants to leave a pointer to callback 
there for when we need the real, unpure, skylines).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]