hi oliver,

TLDR: have both [clonebang] and the object to be notified together in the same 
subpatch - but not on the toplevel! *) - then the order doesn't matter. see 
attached modified example.

---

when a glist is destroyed the following happens for each object: 1) is object 
itself a glist? call canvas_closebang, 2) delete object.

canvas_closebang does the following for each object: is *not* a glist? send 
closebang message

if your [closebang] is in a subpatch and the subpatch comes after the object 
you want to notify, the latter will already be gone once [closebang] is 
triggered.
however, if you have both in the same subpatch, your [closebang] will be 
triggered before any objects in the subpatch are deleted.

one could argue that Pd should really send the "closebang" message in the same 
order as "loadbang" (subpatches first and before any object is actually 
deleted)... 

Christof

*) in old versions of [iemguts], [closebang] didn't trigger on the toplevel. 
this has been fixed about 4 month ago.



> Gesendet: Freitag, 24. August 2018 um 17:26 Uhr
> Von: oliver <[email protected]>
> An: [email protected]
> Betreff: [PD] [closebang] issue ...
>
> hi !
> 
> i just went across a problem that makes me guess that iemguts' 
> [closebang] seems to be relying on creation order to work correctly.
> 
> attached are two simple example patches that should write the content of 
> a [text] object to a file on the disk when the patch is closed. both 
> seem to work (as a connected [print] object reports its bang correctly), 
> but only example nr 1 actually writes the file.
> 
> the difference is, that in example 1 [closebang] was created as the very 
> first object in the main patch. in the second example [closebang] was 
> created after everything else.
> 
> can someone please test it and confirm/falsify ? if this is a bug, can 
> it be corrected, or is that impossible due to PD's patching design ? 
> probably just needs some note in the helpfile ...
> 
> best
> 
> oliver_______________________________________________
> [email protected] mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list
> 

Attachment: closebang_test_2a.pd
Description: Binary data

_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to