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