Hi list, Iemguts has an object [canvasdelete] which, when you create it, goes in and adds a "delete" method for canvases. This allows you to send a "delete $1 $2 etc." message to a canvas, where "$1 $2 etc." are indices of objects you wish to delete from a particular canvas.
In the code I see this comment:
/* this will crash Pd if the object to be deleted is on the stack * workarounds: * - use a clock (see above) * - finally fix this in Pd */
logical time, does that make certain use cases impossible? (If not maybe that's the way to go.) 2) How would you finally fix this in Pd without using a clock?
-Jonathan
On 06/14/2014 08:13 PM, Jonathan Wilkes via Pd-list wrote:
Hi list, Iemguts has an object [canvasdelete] which, when you create it, goes in and adds a "delete" method for canvases. This allows you to send a "delete $1 $2 etc." message to a canvas, where "$1 $2 etc." are indices of objects you wish to delete from a particular canvas.
In the code I see this comment:
/* this will crash Pd if the object to be deleted is on the stack
- workarounds:
- use a clock (see above)
- finally fix this in Pd
*/
- How do I use a clock? If the object no longer outputs in zero
the problem is, that if an object delete's itself, it will delete a context that is referenced later when unwinding the stack.
logical time, does that make certain use cases impossible? (If not maybe that's the way to go.)
[canvasdelete] itself uses a clock.
- How would you finally fix this in Pd without using a clock?
basically we have to defer deletion of a context until it is no longer used. afaict, there are two ways:
basically the clock_delay() method used in [canvasdelete].
anymore.
gfasdrm IOhannes
On 06/14/2014 02:33 PM, IOhannes m zmölnig via Pd-list wrote:
On 06/14/2014 08:13 PM, Jonathan Wilkes via Pd-list wrote:
Hi list, Iemguts has an object [canvasdelete] which, when you create it, goes in and adds a "delete" method for canvases. This allows you to send a "delete $1 $2 etc." message to a canvas, where "$1 $2 etc." are indices of objects you wish to delete from a particular canvas.
In the code I see this comment:
/* this will crash Pd if the object to be deleted is on the stack * workarounds: * - use a clock (see above) * - finally fix this in Pd */
- How do I use a clock? If the object no longer outputs in zero
the problem is, that if an object delete's itself, it will delete a context that is referenced later when unwinding the stack.
Thanks.
Where is the stack-maintenance code for Pd located?
-Jonathan
On 06/15/2014 11:49 AM, IOhannes m zmölnig via Pd-list wrote:
On 06/14/2014 09:50 PM, Jonathan Wilkes via Pd-list wrote:
Where is the stack-maintenance code for Pd located?
on the stack? (like: automatically, as in other C-implemented binaries)
Oh. I thought Pd had some specific code related to the stack, but I guess I was thinking of the pdfile-reading stuff in pd.c.
-Jonathan